Ghost and Digital Ocean and Maintenance

As a non-techie, I had some general questions about hosting Ghost on Digital Ocean (DO). Please assume that I am starting with a very small site and a $10 Droplet.

My basic understanding is that when you install Ghost on a Droplet on DO that Droplet needs to maintained regularly, correct? I understand from tech people that if its setup “properly” it shouldn’t need too much maintenance.

So, am I right in believing that maintenance will involve running software and security updates and so on. I am not putting backups in the category of maintenance because for me that should be done automatically.

So, how often would you say the DO droplet needs to be maintained? Once a month, once every 2 months, once every 6 months? Email alerts will be set up logwatch so that if something goes wrong an alert is received.

Lastly, how long should it take a tech to do the maintenance (on average)?

I am trying to work out if the work involved makes it worth the savings/flexibility that DO offers!

I’m self hosting on a Digital Ocean droplet, and so far the maintenance involves simply updating the server with the latest Linux updates and dependencies. This takes ~3 minutes and you can do it weekly or monthly depending on how up to date and secure you want the server to be.

You can even automate this on a cron job if you wanted to. Then again, I have everything set up using Docker, so SSL is automatically renewed, and everything is pretty easy to maintain and update. I assume the Ghost CLI would achieve the same effect.

As such, on average, I would say it takes around 5 minutes of maintenance every two weeks or so for updates and just checking on server health. Perhaps even less. Backups can be done automatically using DigitalOcean (they backup only once a week automatically though), so you might want to set up automated snapshots if required.

1 Like

newbie here. could you pls list a step-by-step procedure for setting up ghost on digitial ocean with the steps for maintenance? appreciating a response.

Hi.

So I start an Ubuntu server on Digital Ocean (follow their guide to see how). Then, I connect to the server’s terminal via SSH ssh <ip_of_server> <user>.

From there, you can install docker and docker compose by following the instructions: Install Docker Engine on Ubuntu | Docker Documentation

Then, I make a new folder for Ghost, and add a docker-compose.yaml to start up the Ghost container and its dependencies.

version: "3.7"

services:
  ghost:
    container_name: ${GHOST_CONTAINER_NAME}
    image: ghost:latest
    volumes:
      - ${GHOST_CONTENT_PATH}:/var/lib/ghost/content
    environment:
      - url=${GHOST_URL}
      - database__client=${DB_CLIENT}
      - database__connection__host=${DB_CONTAINER_NAME}
      - database__connection__user=${DB_USER}
      - database__connection__password=${DB_PASSWORD}
      - database__connection__database=${DB_NAME}
      - mail__from=${GHOST_ADMIN_EMAIL}
      - mail__transport=${GHOST_MAIL_TRANSPORT}
      - mail__options__service=${GHOST_MAIL_SERVICE}
      - mail__options__host=${GHOST_MAIL_HOST}
      - mail__options__port=${GHOST_MAIL_PORT}
      - mail__options__auth__user=${GHOST_MAIL_USER}
      - mail__options__auth__pass=${GHOST_MAIL_PASSWORD}
      - NODE_ENV=${PROJECT_STATUS} # Production or development
      - VIRTUAL_HOST=${GHOST_DOMAINS}
      - VIRTUAL_PORT=${GHOST_PORT}
      - LETSENCRYPT_HOST=${GHOST_DOMAINS}
      - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
    networks:
      - ${FRONTEND_NETWORK}
      - ${BACKEND_NETWORK}
    depends_on:
      - db
    restart: unless-stopped

  db:
    container_name: ${DB_CONTAINER_NAME}
    image: mysql:5.7
    networks:
      - ${BACKEND_NETWORK}
    volumes:
      - ${DB_PATH}:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=${DB_NAME}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
    restart: unless-stopped

networks:
  webproxy:
    external: true
  backend_network:
    driver: bridge
    name: backend_network

All those curly brackets in the above compose file is basically pulling values from an .env file in the same folder. Fill that up with your configuration and secrets.

Then it’s as simple as doing docker-compose up -d to start Ghost.

For maintenance, you juts have to update your Linux distro (Ubuntu) whenever they tell you to do so. So, just login freqeuntly via SSH and do an apt-get update, apt-get upgrade to update stuff on your Linux server. Make sure to take a snapshot / backup before doing so.

You can either make a cron job for database dumps if you want to backup yourself, or you can also rely on DigitalOcean’s automatic backup, although that’s only once a week.

1 Like