How to Install Docmost using Docker on Ubuntu 24.04

Docmost is a Docker-based tool that facilitates collaborative documentation management, leveraging containers for scalability and ease of deployment. It aims to streamline workflow efficiency by providing a straightforward platform for creating and maintaining documentation within teams.

Update and Upgrade System

Ensure your system is up to date and upgraded to the latest packages,

apt update -y

apt upgrade -y

Install Required Packages

Install necessary packages for setting up dependencies,

apt-get update
apt-get install ca-certificates curl

Set Up Docker Repository Key and Repository

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,

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Update apt and Install Docker

Updating apt and installing Docker and its dependencies from the Docker repository,

apt-get update

apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Output:

root@vps:~# apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  docker-ce-rootless-extras libltdl7 libslirp0 pigz slirp4netns

Verify Docker Installation

Run a Docker container to verify that Docker is installed and functioning correctly,

docker run hello-world

Output:

root@vps:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete 
Digest: sha256:94323f3e5e09a8b9515d74337010375a456c909543e1ff1538f5116d38ab3989
Status: Downloaded newer image for hello-world:latest

Hello from Docker!

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   2775      0 --:--:-- --:--:-- --:--:--  2785

Generate Secret Key

Generate a secret key using the below command,

root@vps:~/docmost# openssl rand -hex 32

Output:

root@vps:~/docmost# openssl rand -hex 32
e4615998d415076129c3399a010f4e702fcbc5562be3ab80b3602ad18597f828
root@vps:~/docmost#

Add the secret key in docker-compose.yml file

nano docker-compose.yml

Replace the secret key,

APP_SECRET: "REPLACE_WITH_LONG_SECRET"

to

APP_SECRET: "e4615998d415076129c3399a010f4e702fcbc5562be3ab80b3602ad18597f828"

Save and exit the file.

Start Docmost Containers

Launch Docmost containers using Docker Compose,

docker compose up -d

Output:

root@vps:~/docmost# docker compose up -d
WARN[0000] /root/docmost/docker-compose.yml: `version` is obsolete 
[+] Running 38/3
 ✔ docmost Pulled                                                                                                                           47.1s 
 ✔ db Pulled                                                                                                                                14.9s 
 ✔ redis Pulled                                                                                                                              5.6s 
[+] Running 7/7
 ✔ Network docmost_default      Created                                                                                                      0.2s 
 ✔ Volume "docmost_docmost"     Created                                                                                                      0.0s 
 ✔ Volume "docmost_db_data"     Created                                                                                                      0.0s 
 ✔ Volume "docmost_redis_data"  Created                                                                                                      0.0s 
 ✔ Container docmost-db-1       Started                                                                                                      0.8s 
 ✔ Container docmost-redis-1    Started                                                                                                      0.8s 
 ✔ Container docmost-docmost-1  Started                                                                                                      0.9s 
root@vps:~/docmost#

Configure Firewall for Docmost

Enable to firewall using below command,

ufw enable

Output:

root@vps:~/docmost# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
root@vps:~/docmost#

Allow incoming traffic on port 3000/tcp for Docmost,

ufw allow 3000/tcp

Output:

root@vps:~/docmost# ufw allow 3000/tcp
Rules updated
Rules updated (v6)
root@vps:~/docmost#

Reload the firewall,

ufw reload

Check the firewall status using below command,

ufw status

Output:

root@vps:~/docmost# ufw status
Status: active

To                         Action      From
--                         ------      ----
3000/tcp                   ALLOW       Anywhere                  
3000/tcp (v6)              ALLOW       Anywhere (v6)             

root@vps:~/docmost#

Restart Docmost Containers

docker compose up -d

Output:

root@vps:~/docmost# docker compose up -d
WARN[0000] /root/docmost/docker-compose.yml: `version` is obsolete 
[+] Running 3/0
 ✔ Container docmost-db-1       Running                                                                                                      0.0s 
 ✔ Container docmost-redis-1    Running                                                                                                      0.0s 
 ✔ Container docmost-docmost-1  Running                                                                                                      0.0s 
root@vps:~/docmost#

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

Click on New Page to start to create wiki/document,

image

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