How to Install Docmost using Docker on AlmaLinux 9

Docmost is an open-source collaborative wiki and documentation software. As an open-source alternative to Notion and Confluence, Docmost is ideal for managing wikis, knowledge bases, or extensive project documentation. It provides all the tools you need to create, collaborate, and share knowledge effortlessly. Docmost supports the creation of Spaces, which can be tailored to different teams, projects, or departments. Each Space has its own permissions, ensuring secure and organized collaboration. It is Designed with seamless real-time collaboration, and allows multiple users to work on the same page simultaneously without overwriting each other's contributions. Additionally, the rich text editor includes support for markdown shortcuts, making content creation intuitive and efficient."

This guide will walk you through the steps to install Docmost on AlmaLinux 9 using Docker.

Update Your System

Before starting the installation process, make sure your system is up to date. Open a terminal and run:

dnf update -y

Install Required Packages

Install necessary packages for setting up dependencies,

dnf install -y yum-utils

Install Docker

If Docker is not already installed on your system, you can set it up by adding the Docker repository key and repository using the following steps:

Setting up Docker's repository allows you to install Docker and related tools from Docker's official repositories. This includes adding the Docker GPG key and repository to your system,

mkdir -p /etc/pki/rpm-gpg
curl -fsSL https://download.docker.com/linux/centos/gpg -o /etc/pki/rpm-gpg/docker.asc
chmod a+r /etc/pki/rpm-gpg/docker.asc

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

dnf makecache

dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start and enable Docker service

systemctl start docker

systemctl enable docker

Verify Docker installation

docker --version

Output:

[root@vps ~]# docker --version
Docker version 27.0.3, build 7d4bcd8

Prepare Docmost Configuration

Create a directory for Docmost and download its Docker Compose configuration file,

mkdir docmost
cd docmost
curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.yml

Output:

[root@vps ~]# mkdir docmost
[root@vps ~]# cd docmost
[root@vps docmost]# curl -O https://raw.githubusercontent.com/docmost/docmost/main/docker-compose.yml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   833  100   833    0     0   4024      0 --:--:-- --:--:-- --:--:--  4063

Generate Secret Key

Generate a secret key using the below command,

openssl rand -hex 32

Output:

[root@vps docmost]# openssl rand -hex 32
f73a69f2b9bbe568a5ec4df3a1e874eaf196ce2177d7ff446be6e53fcaed25c2

Temporarily store this secret key on your local system using a text editor or any other method. We will use this key in the docker-compose.yml file

Now, open the docker-compose.yml file in a text editor. If you don't have a text editor installed, you can install Nano using the following command:

dnf install nano -y
nano docker-compose.yml

The downloaded docker-compose.yml file should include the following template with default environment variables:

version: "3"

services:
  docmost:
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: "http://localhost:3000"
      APP_SECRET: "REPLACE_WITH_LONG_SECRET"
      DATABASE_URL: "postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost?schema=public"
      REDIS_URL: "redis://redis:6379"
    ports:
      - "3000:3000"
    restart: unless-stopped
    volumes:
      - docmost:/app/data/storage

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: docmost
      POSTGRES_USER: docmost
      POSTGRES_PASSWORD: STRONG_DB_PASSWORD
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data

  redis:
    image: redis:7.2-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data

volumes:
  docmost:
  db_data:
  redis_data:

Replace the default configurations with the following:

APP_URL: "http://Your_server_IP_address:3000"

APP_SECRET: "f73a69f2b9bbe568a5ec4df3a1e874eaf196ce2177d7ff446be6e53fcaed25c2"

DATABASE_URL: "postgresql://docmost:STRONG_DB_PASSWORD@db:5432/docmost?schema=public"

POSTGRES_PASSWORD: STRONG_DB_PASSWORD

Note: Replace Your_server_IP_address with your actual server IP address or domain name

Note: Enter the key you generated earlier in app_secret:

Note: Replace Strong_DB_Password with your desired database password.

Save and exit the file.

Configure Firewall for Docmost

Check Firewall Status

systemctl status firewalld

Start and Enable the firewall if it's disabled.

systemctl start firewalld
systemctl enable firewalld

Need to allow incoming traffic on port 3000/tcp for Docmost using firewalld:

firewall-cmd --zone=public --add-port=3000/tcp --permanent

Reload the firewall,

firewall-cmd --reload

Check the firewall status using below command,

firewall-cmd --zone=public --list-ports

Start Docmost Containers

Launch Docmost containers using Docker Compose,

docker compose up -d

Verifying Docmost Installation

Once you have successfully set up and started the Docmost services, you can verify the installation by following these steps:

Open Your Web Browser and navigate to docmost, enter the following URL in your browser's address bar,

http://localhost:3000

Note: Replace the localhost with your actual IP Address

Setup the Workspace Name, Admin Name, Email, Login Password and click on setup workspace,

image

Click on General to get the Docmost dashboard,

image

You'll see the Docmost dashboard like below,

image

That’s it! These steps cover verifying the successful installation and initial setup of Docmost on your AlmaLinux 9 server. Enjoy using Docmost for document management and collaboration.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS