Skip to main content

Flarum Installation Process on Linode

Here are the commands I used to get Flarum installed on Linode.

After your Linode VPS is set up, head over to the Domains link in the left menu and set up your new domain/sub-domain and be sure to attach it to attach the domain to your Linode VPS as shown in the video.

Once that has been done, login via SSH and run the following command to install Portainer:

docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Once that is up and running, head over to your new portainer instance by going to your Linode's IP address and adding port 9000 to the end.

Create your admin account and log in.

Now head over to the Environment link on the left and click it. Then click "local" and enter your VPS IP address and save.

Now go back to the Portainer home page and then click "Stacks".

Create a new stack and name it Flarum.

Then paste the following into the web editor:

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - /home/docker/npm/data:/data
      - /home/docker/npm/letsencrypt:/etc/letsencrypt
    networks:
      - nginxproxymanager_default

  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    environment:
      - DEBUG=false
      - FORUM_URL=https://forum.yoursite.xyz
      - DB_HOST=mariadb
      - DB_NAME=flarum
      - DB_USER=flarum
      - DB_PASS=xxxxxxxxxx
      - DB_PREF=flarum_
      - DB_PORT=3306
      - FLARUM_ADMIN_USER=admin
      - FLARUM_ADMIN_PASS=xxxxxxxxxx
      - FLARUM_ADMIN_MAIL=you@youremail.com
      - FLARUM_TITLE=Test flarum
    volumes:
      - /home/docker/flarum/assets:/flarum/app/public/assets
      - /home/docker/flarum/extensions:/flarum/app/extensions
      - /home/docker/flarum/storage/logs:/flarum/app/storage/logs
      - /home/docker/flarum/nginx:/etc/nginx/flarum
    ports:
      - 8868:8888
    depends_on:
      - mariadb
    networks:
      - nginxproxymanager_default

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxxxxxxx
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=xxxxxxxxxx
    volumes:
      - /home/docker/flarum/mysql/db:/var/lib/mysql
    networks:
      - nginxproxymanager_default     
      
networks:
  nginxproxymanager_default:
    external: false    

Be sure to adjust the settings (passwords, emails, volume locations on your host, etc.) here for your particular instance.

Click the blue "Deploy" button at the bottom of the page and then wait for it to deploy.

Now head over to your VPS IP address on port 81 and log into your Nginx Proxy Manager with the default username and password.

The first time you log in, you'll be asked to change your username and password. Do that.

Head over to the SSL tab across the top of the window.

Enter the URL you want to use in the top box. 

Check all the radio tick-boxes except the DNS verification option. Check the "I agree to the terms" box and then submit.

If everything goes well, your SSL will be pulled and you'll be able to head over to the Hosts tab and create a new host.

Enter the URL you configured in your Linode account for this setup.

Select "http" and enter the docker container IP address for Flarum. You can find this in Portainer next to the Flarum container in the container list.

For the forward port, you'll enter 8888.

Check all the radio tick-boxes and submit the form. 

If you don't receive any errors, you can then click the URL on the page and you should be taken over to your new Flarum URL with an SSL attached to it.

Fill in the blanks for all the fields on the page as shown in the video and then submit the form. 

Within just a couple of moments, you should be taken to your newly-installed Flarum setup.