Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Deploy October CMS With Docker

October is a free, open-source, self-hosted CMS platform based on the Laravel PHP Framework.

Steps

Deploy an Ubuntu 18.04 Server with at least 1GB of RAM. Add some swap too if you are on something like DigitalOcean that uses local SSDs.

Install docker.

Install docker-compose

Create a docker-compose.yml file on your server with the following (editing the DB_PASSWORD and MYSQL_PASSWORD to something else, but matching each other).

version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    ports:
      - 80:80
    environment:
      - DB_TYPE=mysql
      - DB_HOST=db #DB_HOST should match the service name of the database container
      - DB_DATABASE=octobercms
      - DB_USERNAME=octobercms
      - DB_PASSWORD=octobercms

  database:
    image: mariadb
    container_name: db
    restart: always
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 1
      MYSQL_DATABASE: octobercms
      MYSQL_USER: octobercms
      MYSQL_PASSWORD: octobercms
    volumes:
       - $HOME/volumes/mysql/data:/var/lib/mysql

Then run the following command to set up the database (run migrations)

docker-compose exec web php artisan october:up

Log Into the Backend

Navigate to your server's IP/hostname and append /backend to the URL. Then login with admin for the username and password.

References

Last updated: 7th April 2020
First published: 7th April 2020