Home
Blog
Create a Ghost blog on Caprover

Create a Ghost blog on Caprover

8/3/2021

I'm writing this because it took me days to create self-hosting my blog again on Ghost.

I was hosting my blog on a Linux server before using Ghost. but moved to Hugo and I wanted to give Ghost another try.

I'm using Caprover to handle most of my websites/apps. so I wanted to host Ghost using Caprover.

I tried over 10 times to setup the blog and every time there was a problem. Next, I will list some of the issue and their solutions.

#Port issue

Assuming your main url is blog.ahmd.world, If you didn't setup Ghost the right way you'll find a port in your URL like this blog.ahmd.world:80

I was trying to setup the blog on Caprover but the default port that you'll find there is 80 and if you'll use it on https not http. you need to use a different port so the solution in my case was to use the port 443.

#Error 500: ECONNRESET

I found the sultion to this issue is to edit the file config.production.json and add the next code into it

1"pool": {
2    "min":0
3}

Inside your server

1# list all docker volumes
2root@server: docker volume ls
3DRIVER    VOLUME NAME
4local     captain--ghost-data
5local     captain--ghost-mariadb-data
1root@server: docker volume inspect captain--ghost-data
2
3[
4    {
5        "CreatedAt": "2021-02-22T13:55:32Z",
6        "Driver": "local",
7        "Labels": null,
8        "Mountpoint": "/var/lib/docker/volumes/captain--ghost-data/_data",
9        "Name": "captain--ghost-data",
10        "Options": null,
11        "Scope": "local"
12    }
13]
1# add the missing part to the config file
2root@server: vim /var/lib/docker/volumes/captain--personal-data/_data/ghost/config.production.json
3{
4  "database": {
5    "client": "mysql",
6    "connection": {
7      "host": "host",
8      "port": 1234,
9      "password": "password",
10      "user": "user",
11      "database": "database"
12    },
13   "pool": {
14      "min": 0
15    }
16  },