Selfhosting Ghost - the easiest way with v5.8.3
Ghost is the service I use to create this site. It is lightweight and pretty straightforward to use. It offers in-built membership, email and paywall tools (not that I specifically use any of them) but also offers powerful and free out-of-the-box themes to change up your look. If they aren't enough, then you can either browser the paid themes market place, OR you can modify the style sheets yourself - yup, it makes those 100% available to you, so with a little bit of html and css knowhow, you can make your site completely your own.
The thing is, if you follow the official dockerhub guide or the bitnami github repo then it's not the easiest of tools to set up. Assuming you want this blog to be exposed to the outside world and therefore have your own domain ready to go, I'm going to show you just how simple this can be to get up and running using the inbuilt SQLite database.
Prerequisites
You will need to have, be able to do, or provide the items below:
- Docker and docker-compose installed on your machine
- The ability to SSH / use CLI/terminal on your machine, or use Portainer to spin up your stacks
- Some sort of access and relevant permissions to manage and create new directories
- A Fully Qualified Domain Name (FQDN, e.g.
pointtosource.com) - A reverse proxy already set up for the service you want, on its own docker network (for instance called
proxy) with the relevant SSL certificate(s) (check out my SWAG article for some info on how to do that if you haven't already)
Creating the file structure
- Navigate to your docker directory and create a folder called
ghost.
Done.
Creating your docker-compose and .env files
- Inside your
ghostdirectory, create a file calleddocker-compose.yml, then copy in the following:
services:
ghost:
image: ghost:5.8.3
container_name: ghost # change as necessary
ports:
- '2368:2368' # change before the `:` as necessary
volumes:
- .:/var/lib/ghost/content
- /etc/localtime:/etc/localtime:ro
# uncomment below to connect it to your own network
#networks:
#- [add your network name here]
restart: unless-stopped[ ] bracketsThat's it, there's no .env file.
you can copy paste the above to your Portainer stack as well
Spinning up the container
- From your
ghostdirectory in SSH type the following command:
docker-compose up -dOR
- In Portainer, create the stack
Accessing your new Ghost container
You should now be able to access the initial set up stages for your new Ghost container by going to your browser and typing in http://yourMachineIP:2368/ghost (if you changed the port in the compose file, make sure it's reflected here).
You should see a screen like this:

Once you've filled in your new credentials (don't forget to save them!) you will see a screen which offers you a couple of next steps options:

And you're off! Explore and take a look around, and enjoy creating your very own website and/or blog!
If you plan to set up a reverse proxy
A slight change needs to be made to the docker-compose.yml file to tell ghost that an external URL is suitable for access. Add the below environment variable (where environment is in the same column as image, container_name etc.):
environment:
URL: https://sub.yourdomain.com You will now be able to set up your reverse proxy and access your ghost setup and site from the domain.
IP:port access, as it will try and forward that to this new URLRelated Articles



