{"id":1105,"date":"2026-11-17T09:00:00","date_gmt":"2026-11-17T09:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1105"},"modified":"2026-11-17T09:00:00","modified_gmt":"2026-11-17T09:00:00","slug":"install-docmost-docker-almalinux-8","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/17\/install-docmost-docker-almalinux-8\/","title":{"rendered":"How to Install Docmost Using Docker on AlmaLinux 8"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install Docmost using Docker on AlmaLinux 8 to run a collaborative wiki behind HTTPS on your own VPS. Allow about 15 minutes for the first image download, domain check, and workspace setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>A 64-bit AlmaLinux 8 VPS with at least 2 GB of RAM and 10 GB of free disk space. More memory is useful if several people will edit pages at once.<\/li>\n\n\n<li>SSH access as <code>root<\/code>, or a regular Linux account with working <code>sudo<\/code> privileges.<\/li>\n\n\n<li>A domain such as <code>YOUR_DOMAIN<\/code> with an A record pointing to <code>SERVER_IP<\/code>. Caddy uses that hostname to request the TLS certificate.<\/li>\n\n\n<li>Inbound TCP ports 80 and 443 available at both the VPS provider and the server firewall. You do not need to expose port 3000 publicly.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> with root access if you still need a server for this deployment.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This guide uses the RHEL-compatible Docker repository, DNF, and firewalld. Commands assume a non-root SSH account; if you are already <code>root<\/code>, omit <code>sudo<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Confirm AlmaLinux 8 and update the host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Checking the release and architecture first prevents an EL8 server from accidentally receiving instructions for another distribution.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. \/etc\/os-release\nprintf '%s\\n' \"$PRETTY_NAME\"\nuname -m\nsudo dnf upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The release should begin with <code>AlmaLinux 8<\/code>, and the architecture should be <code>x86_64<\/code> or <code>aarch64<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AlmaLinux 8.x (...)\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The minor version and kernel text can change as AlmaLinux publishes updates. Resolve any repository, DNS, or GPG-signature error before installing Docker.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Install Docker Engine and Compose<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docker supplies the container runtime, while the Compose plugin lets you start Docmost and its two dependencies from one file. Docker\u2019s <a href=\"https:\/\/docs.docker.com\/engine\/install\/rhel\/\" target=\"_blank\" rel=\"noopener\">RHEL installation instructions<\/a> use the same RPM repository approach on maintained EL8 systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remove packages that can conflict with Docker\u2019s runtime on a fresh VPS. This does not remove Docker images or volumes, but do not run it on a host where you still need active Podman workloads.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf remove -y docker \\\n  docker-client docker-client-latest docker-common docker-latest \\\n  docker-latest-logrotate docker-logrotate docker-engine podman runc\nsudo dnf install -y dnf-plugins-core ca-certificates curl openssl\nsudo dnf config-manager --add-repo https:\/\/download.docker.com\/linux\/rhel\/docker-ce.repo\nsudo dnf makecache\nsudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\nsudo systemctl enable --now docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>sudo<\/code> for Docker commands throughout this guide. The Docker socket grants root-equivalent control, so there is no need to add your SSH account to the <code>docker<\/code> group just to complete this setup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl is-active docker\nsudo docker version --format 'Client {{.Client.Version}} \/ Server {{.Server.Version}}'\nsudo docker compose version\nsudo docker run --rm hello-world<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected checks look similar to this; patch numbers will vary:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nClient 29.x.y \/ Server 29.x.y\nDocker Compose version v2.x.y\nHello from Docker!<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Create protected Docmost secrets<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docmost needs an application secret, and PostgreSQL needs a password that is used consistently by both the database container and the application connection string. Hexadecimal values are convenient here because they do not require URL escaping.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl rand -hex 32\nopenssl rand -hex 24\nsudo install -d -m 0750 \/opt\/docmost\ncd \/opt\/docmost\nsudo vi .env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create <code>\/opt\/docmost\/.env<\/code> in <code>vi<\/code> using this content. Replace the uppercase values with the generated strings and your real hostname.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>APP_URL=https:\/\/YOUR_DOMAIN\nAPP_SECRET=REPLACE_WITH_64_HEX_CHARACTERS\nDB_PASSWORD=REPLACE_WITH_48_HEX_CHARACTERS<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file, then limit access because it contains a database credential:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod 600 \/opt\/docmost\/.env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>APP_URL<\/code> must exactly match the URL you will open in the browser. The <a href=\"https:\/\/docmost.com\/docs\/installation\" target=\"_blank\" rel=\"noopener\">Docmost installation documentation<\/a> requires a random secret of at least 32 characters and uses PostgreSQL plus Redis for the standard Docker deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Add Caddy and the Compose definition<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The reverse proxy terminates HTTPS and forwards requests to Docmost, including WebSocket traffic used by real-time editing. Docmost listens only on loopback, so an internet user cannot bypass Caddy by visiting port 3000.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the Caddy configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo vi Caddyfile<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following, replacing <code>YOUR_DOMAIN<\/code> with the same hostname used in <code>.env<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>YOUR_DOMAIN {\n    reverse_proxy docmost:3000\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now create the Compose file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi docker-compose.yml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use this configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n  caddy:\n    image: caddy:2\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    volumes:\n      - .\/Caddyfile:\/etc\/caddy\/Caddyfile:ro,Z\n      - caddy_data:\/data\n      - caddy_config:\/config\n    depends_on:\n      - docmost\n    restart: unless-stopped\n\n  docmost:\n    image: docmost\/docmost:latest\n    depends_on:\n      - db\n      - redis\n    environment:\n      APP_URL: ${APP_URL}\n      APP_SECRET: ${APP_SECRET}\n      DATABASE_URL: postgresql:\/\/docmost:${DB_PASSWORD}@db:5432\/docmost\n      REDIS_URL: redis:\/\/redis:6379\n    ports:\n      - \"127.0.0.1:3000:3000\"\n    restart: unless-stopped\n    volumes:\n      - docmost:\/app\/data\/storage\n\n  db:\n    image: postgres:18\n    environment:\n      POSTGRES_DB: docmost\n      POSTGRES_USER: docmost\n      POSTGRES_PASSWORD: ${DB_PASSWORD}\n    restart: unless-stopped\n    volumes:\n      - db_data:\/var\/lib\/postgresql\n\n  redis:\n    image: redis:8\n    command: [\"redis-server\", \"--appendonly\", \"yes\", \"--maxmemory-policy\", \"noeviction\"]\n    restart: unless-stopped\n    volumes:\n      - redis_data:\/data\n\nvolumes:\n  docmost:\n  db_data:\n  redis_data:\n  caddy_data:\n  caddy_config:<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Z<\/code> mount flag gives the Caddy container an SELinux-compatible label for the local configuration file. It is safer than disabling SELinux, and the named volumes keep pages, uploaded files, database records, Redis data, and certificates outside the container layers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Open firewalld and launch the stack<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Only the reverse proxy needs public access. Allowing HTTP as well as HTTPS lets Caddy complete certificate challenges and redirect visitors to the encrypted endpoint.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable --now firewalld\nsudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https\nsudo firewall-cmd --reload\nsudo firewall-cmd --list-services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The final command should include <code>http<\/code> and <code>https<\/code>. Validate the resolved Compose model before downloading several large images, then start the services:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose config --quiet\nsudo docker compose pull\nsudo docker compose up -d\nsudo docker compose ps<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>config --quiet<\/code> produces no output when the YAML and <code>.env<\/code> substitutions are valid. Once startup finishes, the four services should show a running state:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME                 SERVICE   STATUS    PORTS\ndocmost-caddy-1      caddy     Up        0.0.0.0:80-&gt;80\/tcp, 0.0.0.0:443-&gt;443\/tcp\ndocmost-docmost-1    docmost   Up\ndocmost-db-1         db        Up\ndocmost-redis-1      redis     Up<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compose may choose different container names. A service that keeps restarting needs the logs checked before you continue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the Docmost installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Test the health endpoint through the domain rather than only from inside Docker. This single request exercises DNS, Caddy\u2019s certificate, the proxy route, and Docmost\u2019s HTTP listener.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsS -o \/dev\/null -w 'HTTP %{http_code}\\n' https:\/\/YOUR_DOMAIN\/api\/health<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HTTP 200<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open <code>https:\/\/YOUR_DOMAIN<\/code> in a browser. Docmost should show its workspace setup form. Enter a workspace name, administrator name, email address, and a strong unique password, then create the workspace. Create a test page after the dashboard opens so you confirm that the editor and storage volume both work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Review recent logs after the first login:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose logs --tail=40 caddy docmost db redis<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Normal logs should not contain a repeating restart loop, PostgreSQL authentication failure, or ACME certificate error.<\/p>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Run Docmost on Linux\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">AlmaLinux VPS<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Run Docmost on Linux<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Get a Docker-ready AlmaLinux VPS for a private, HTTPS-protected documentation workspace.<\/p>\n\t<\/div>\n\t<a class=\"vl-cta-banner__button\" href=\"\/buy-vps\" aria-label=\"View Linux VPS plans\">View Linux VPS plans<\/a>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code>No match for argument: docker-ce<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Docker repository was not added or DNF is using stale metadata. Confirm that the host reports AlmaLinux 8 and refresh the repository cache, then repeat the Docker package install:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf config-manager --add-repo https:\/\/download.docker.com\/linux\/rhel\/docker-ce.repo\nsudo dnf clean all\nsudo dnf makecache\nsudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Caddy shows <code>permission denied<\/code> for <code>Caddyfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SELinux is correctly preventing an unlabeled bind mount from being read. Make sure the Compose entry ends in <code>:ro,Z<\/code>, then recreate Caddy so Docker applies the label:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose up -d --force-recreate caddy\nsudo docker compose logs --tail=40 caddy<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">The browser returns <code>502 Bad Gateway<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Caddy is reachable, but Docmost has not finished starting or the application container exited. Check the application and dependency logs, correct the first reported error, and restart the stack:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose ps\nsudo docker compose logs --tail=80 docmost db redis\nsudo docker compose restart<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Caddy cannot get a certificate<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The domain may still point elsewhere, or an upstream security group may block port 80 or 443. Confirm the A record resolves to <code>SERVER_IP<\/code>, verify firewalld lists both services, and allow the same ports in the VPS provider firewall.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>password authentication failed for user \"docmost\"<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PostgreSQL keeps the original password in its named volume. If <code>DB_PASSWORD<\/code> was changed after the first startup, restore the original value in <code>.env<\/code> and restart; never use <code>docker compose down -v<\/code> on a live installation because removing the database volume destroys stored data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardening and maintenance<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>Keep <code>127.0.0.1:3000<\/code> in the Compose port mapping and do not publish PostgreSQL or Redis ports.<\/li>\n\n\n<li>Back up the <code>docmost<\/code>, <code>db_data<\/code>, <code>redis_data<\/code>, <code>caddy_data<\/code>, and <code>caddy_config<\/code> volumes before upgrades or host maintenance.<\/li>\n\n\n<li>Update deliberately from <code>\/opt\/docmost<\/code> with <code>sudo docker compose pull<\/code> followed by <code>sudo docker compose up -d<\/code>; review image changes before using them on a production wiki.<\/li>\n\n\n<li>After confirming the application works, tighten SSH access with the <a href=\"https:\/\/vpslake.com\/sshd-hardening-generator\">VPSLake SSH hardening generator<\/a> and keep <code>.env<\/code> readable only by root.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can Docmost run on an IP address instead of a domain?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It can be tested over an IP if you publish port 3000 and change <code>APP_URL<\/code>, but that removes Caddy\u2019s automatic trusted certificate. A domain is the practical choice for a public workspace and for secure real-time editing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does this setup include Caddy when Docmost already serves HTTP?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Caddy handles certificate issuance, HTTPS renewal, and the reverse-proxy connection to Docmost. It also leaves the application port private, which reduces the number of internet-facing services on the VPS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where are my pages and uploads stored?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Docmost stores application files in the <code>docmost<\/code> named volume, while PostgreSQL uses <code>db_data<\/code>. Redis and Caddy use their own volumes, so recreating containers does not by itself remove workspace data or certificate state.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I stop the installation without deleting it?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>sudo docker compose stop<\/code> from <code>\/opt\/docmost<\/code> to stop the containers while retaining their volumes. Use <code>sudo docker compose start<\/code> to bring the same stack back without re-running the workspace setup.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Can Docmost run on an IP address instead of a domain?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"It can be tested over an IP if you publish port 3000 and change `APP_URL`, but that removes Caddy\u2019s automatic trusted certificate. A domain is the practical choice for a public workspace and for secure real-time editing.\"}}, {\"@type\": \"Question\", \"name\": \"Why does this setup include Caddy when Docmost already serves HTTP?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Caddy handles certificate issuance, HTTPS renewal, and the reverse-proxy connection to Docmost. It also leaves the application port private, which reduces the number of internet-facing services on the VPS.\"}}, {\"@type\": \"Question\", \"name\": \"Where are my pages and uploads stored?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Docmost stores application files in the `docmost` named volume, while PostgreSQL uses `db_data`. Redis and Caddy use their own volumes, so recreating containers does not by itself remove workspace data or certificate state.\"}}, {\"@type\": \"Question\", \"name\": \"How do I stop the installation without deleting it?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Run `sudo docker compose stop` from `\/opt\/docmost` to stop the containers while retaining their volumes. Use `sudo docker compose start` to bring the same stack back without re-running the workspace setup.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install Docmost using Docker on AlmaLinux 8 with PostgreSQL, Redis, Caddy HTTPS, firewalld, and checks for a working private wiki in minutes.","protected":false},"author":1,"featured_media":1106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[5,9],"tags":[94,118,138,139],"class_list":["post-1105","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-almalinux-8","tag-docker","tag-docmost","tag-self-hosting","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/comments?post=1105"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1105\/revisions"}],"predecessor-version":[{"id":4078,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1105\/revisions\/4078"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1106"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}