Run MyBB - Open Source Forum Software - in Docker 🌱

What is MyBB?

MyBB is the free and open source forum software powering thousands of engaging, vibrant, and unique communities across the internet. - https://mybb.com/

Installing Docker

  1. Log into the Linux host and run the following commands in a terminal window
    # install prerequisites
    sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
    # add docker gpg key
    curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
    # add docker software repository
    sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
    # install docker
    sudo apt install docker-ce docker-compose containerd.io -y
    # enable and start docker service
    sudo systemctl enable docker && sudo systemctl start docker
    # add the current user to the docker group
    sudo usermod -aG docker $USER
    # reauthenticate for the new group membership to take effect
    su - $USER

Running MyBB Container

  1. Continue with the following commands in a terminal window
    # create working directories
    mkdir ~/docker/mybb -p && mkdir ~/docker/postgresql -p && mkdir ~/docker/nginx -p
    # set owner of docker directory
    sudo chown "$USER":"$USER" ~/docker -R
    # allow the container to write to working directories
    sudo chmod a+rwx -R ~/docker/mybb
    # download the nginx conf file
    wget -O ~/docker/nginx/default.conf https://gist.githubusercontent.com/kawaii/ed2fbbf11309b8f635a623fa87abce8d/raw/3a5a6e36b238e55aaef519693ca16c82fbafd2fd/default.conf
    # create containers network
    docker network create containers
    # run the postgesql container
    docker run -d --name postgres --network containers -p 5432:5432 -e POSTGRES_USER=mybb_rw -e POSTGRES_PASSWORD=My44_rw$ -e POSTGRES_DB=mybb -v ~/docker/postgresql:/var/lib/postgresql/data --restart=unless-stopped postgres:latest
    # run the mybb container
    docker run -d --name mybb -v ~/docker/mybb:/var/www/html:rw --network containers --restart=unless-stopped mybb/mybb
    # run nginx webserver container
    docker run -d --name nginx --network containers -p 8081:80 -v ~/docker/mybb:/var/www/html:ro -v ~/docker/nginx:/etc/nginx/conf.d:ro --restart=unless-stopped nginx
  2. Open a web browser and navigate to http://DNSorIP:8081
  3. Click Next at the Welcome screen
  4. Click Next at the License Agreement
  5. Click Next at the Requirements Check
  6. Complete the Database Configuration as shown below

    Database Engine: PostgreSQL

    Database Server Hostname: postgres
    Database Username: mybb_rw
    Database Password: My44_rw$
    Database Name: mybb

    Table Prefix: mybb_

  7. Click Next after the table creation completes
  8. Click Next to complete the Table Population
  9. Click Next at the Theme Insertion screen
  10. Modify the Board Configuration form as needed > Click Next
  11. Create an administrator account by entering a Username, Password and Email Address > Click Next
  12. Click the Admin Control Panel link
  13. Login with the administrator username and password created earlier
  14. Welcome to MyBB

Documentation: https://github.com/mybb/docker