{"id":1115,"date":"2026-11-18T13:00:00","date_gmt":"2026-11-18T13:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1115"},"modified":"2026-11-18T13:00:00","modified_gmt":"2026-11-18T13:00:00","slug":"install-docmost-docker-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/18\/install-docmost-docker-rocky-linux-8\/","title":{"rendered":"How to Install Docmost Using Docker on Rocky Linux 8"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install Docmost using Docker on Rocky Linux 8 to run a private collaborative wiki with PostgreSQL, Redis, and HTTPS. With DNS ready, you can reach the workspace setup page in about 15 minutes.<\/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 Rocky Linux 8 VPS with at least 2 GB of RAM and 10 GB of free disk space. Reserve more disk space if users will upload many files.<\/li>\n\n\n<li>SSH access as <code>root<\/code>, or a normal 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 needs the hostname to request a TLS certificate.<\/li>\n\n\n<li>Provider-level access for inbound TCP ports 80 and 443. Docmost\u2019s application port will remain private on the server.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> if you need a Rocky Linux server with root access.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The commands below use <code>sudo<\/code> for a normal SSH account. If you are logged in as <code>root<\/code>, remove <code>sudo<\/code>. Rocky Linux 8 uses DNF and firewalld, and SELinux stays enabled throughout this guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Check Rocky Linux 8 and update the host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: Confirming the release and architecture first helps prevent an incorrect repository or package set from being applied.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. \/etc\/os-release\nprintf '%s\\n' \"$PRETTY_NAME\"\nprintf 'Release: %s\\n' \"$VERSION_ID\"\nuname -m\nsudo dnf upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The release should identify Rocky Linux 8 and a 64-bit architecture:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Rocky Linux 8.x (Green Obsidian)\nRelease: 8.x\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Minor release and kernel text will change as updates arrive. Resolve any mirror, DNS, or GPG-signature error before continuing.<\/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\">Why: Docker runs the application containers, while the Compose plugin starts Docmost, PostgreSQL, Redis, and Caddy from one definition.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a new VPS, remove packages that can conflict with Docker\u2019s runtime. Skip the removal until you have reviewed active containers if this host already runs Podman or another container engine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest 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\">This uses Docker\u2019s <a href=\"https:\/\/docs.docker.com\/engine\/install\/rhel\/\" target=\"_blank\" rel=\"noopener\">official RHEL installation method<\/a> with the RHEL-compatible repository. Keep using <code>sudo docker<\/code> in this guide; membership in the <code>docker<\/code> group grants root-equivalent control of the host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the daemon, Compose plugin, and a disposable container:<\/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 output is similar to this; patch versions 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 settings<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: Docmost needs a long application secret, and PostgreSQL must receive one matching password from both the database container and the application URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generate hexadecimal values so the database password is safe to place in a connection string. Then create the deployment directory and environment file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl rand -hex 32\nopenssl rand -hex 24\nsudo install -d -m 0755 \/opt\/docmost\nsudo vi \/opt\/docmost\/.env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create <code>\/opt\/docmost\/.env<\/code> in <code>vi<\/code>. Use the first random value for <code>APP_SECRET<\/code>, the second for <code>DB_PASSWORD<\/code>, and replace <code>YOUR_DOMAIN<\/code> with the 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 and restrict it because it contains a database credential:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod 600 \/opt\/docmost\/.env\nsudo chown root:root \/opt\/docmost\/.env<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first command generates a 64-character secret, exceeding Docmost\u2019s 32-character minimum. <code>APP_URL<\/code> must exactly match the hostname that visitors will use, including any subdomain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Define the HTTPS proxy and application stack<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: Caddy obtains certificates and forwards WebSockets for the real-time editor, while named volumes keep the wiki data outside disposable container layers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the Caddy configuration. The official <a href=\"https:\/\/docmost.com\/docs\/self-hosting\/reverse-proxy\/caddy\" target=\"_blank\" rel=\"noopener\">Docmost Caddy guide<\/a> uses this service-name proxy pattern:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/opt\/docmost\/Caddyfile<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter this content, using the same hostname as <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 \/opt\/docmost\/docker-compose.yml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following definition:<\/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> option gives the Caddy bind mount an SELinux label without disabling SELinux. Binding Docmost to <code>127.0.0.1<\/code> prevents direct public access to port 3000; Caddy reaches it through the private Compose network. The volumes preserve pages, uploads, database records, Redis data, and certificates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Open firewalld and launch Docmost<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: The firewall should expose SSH and Caddy\u2019s web ports while PostgreSQL, Redis, and the application listener stay off the public interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable firewalld and allow the services needed for administration, HTTP redirects, and HTTPS certificate issuance:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y firewalld\nsudo systemctl enable --now firewalld\nsudo firewall-cmd --permanent --zone=public --add-service=ssh\nsudo firewall-cmd --permanent --zone=public --add-service=http\nsudo firewall-cmd --permanent --zone=public --add-service=https\nsudo firewall-cmd --reload\nsudo firewall-cmd --zone=public --list-services<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see <code>ssh<\/code>, <code>http<\/code>, and <code>https<\/code> in the result. If SSH uses a custom port, add that port instead of the <code>ssh<\/code> service before enabling firewalld, or you may lock yourself out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Validate the rendered configuration, download the images, and start the stack:<\/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\">The first image pull may take several minutes. A healthy result has four services in an <code>Up<\/code> state, with Docmost bound only to loopback:<\/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        127.0.0.1:3000-&gt;3000\/tcp\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 repeatedly restarts needs its logs checked before you open the site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the Docmost installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: One HTTPS request checks DNS, firewalld, Caddy\u2019s certificate, the reverse proxy, and Docmost\u2019s health endpoint together.<\/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. The Docmost workspace setup page should appear. Enter a workspace name, administrator details, and a unique strong password, then create a test page and edit it in a second browser tab to check the collaborative editor.<\/p>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Run Docmost privately\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">Rocky Linux VPS<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Run Docmost privately<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Deploy a Docker-ready Rocky Linux VPS for a collaborative documentation workspace behind HTTPS.<\/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, DNF has stale metadata, or the wrong repository endpoint is configured. Re-add the RHEL-compatible repository and refresh the cache:<\/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 repolist | grep -i docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The last command should show Docker\u2019s stable repository before you retry the package installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Caddy logs <code>permission denied<\/code> for <code>Caddyfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SELinux is correctly blocking an unlabeled bind mount. Confirm the Caddy service mount ends with <code>:ro,Z<\/code>, then recreate only that service:<\/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<p class=\"wp-block-paragraph\">Do not disable SELinux to work around this error.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The browser shows <code>502 Bad Gateway<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Caddy cannot reach Docmost, usually because the application container is still starting or has exited. Check both the service state and recent logs:<\/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<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wait for the database initialization to finish. If the logs show a bad connection string or secret, correct <code>.env<\/code> and recreate the stack with <code>sudo docker compose up -d --force-recreate<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Caddy cannot obtain a certificate<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The domain may not resolve to this VPS, or TCP 80 and 443 may be blocked by the provider firewall. Check DNS from another network, allow both ports at the provider, and inspect Caddy\u2019s error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose logs --tail=80 caddy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the domain\u2014not the server IP\u2014in both <code>Caddyfile<\/code> and <code>APP_URL<\/code>.<\/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 port 3000, PostgreSQL, and Redis unpublished. Only Caddy needs public web ports.<\/li>\n\n\n<li>Back up the <code>docmost<\/code>, <code>db_data<\/code>, and <code>redis_data<\/code> volumes before upgrades or server changes. A VPS snapshot is useful, but keep a separate copy of important documentation.<\/li>\n\n\n<li>Update Rocky Linux regularly, then review and pull new container images during a maintenance window:<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/docmost\nsudo docker compose pull\nsudo docker compose up -d<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>Never commit <code>\/opt\/docmost\/.env<\/code> to a repository or paste its values into support tickets.<\/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 I run Docmost with only a server IP address?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can test the application over plain HTTP, but Caddy cannot obtain a trusted certificate for a bare IP in the normal setup. A DNS name is the practical choice for a secure public deployment and is required by the HTTPS configuration in this guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why are PostgreSQL and Redis separate containers?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Docmost expects PostgreSQL for its application data and Redis for cache and real-time coordination. Keeping them on the private Compose network avoids exposing either service directly to the internet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where are Docmost pages and uploads stored?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Pages and uploaded files are stored in the <code>docmost<\/code> named volume. PostgreSQL records, Redis persistence, and Caddy\u2019s certificate state are stored in their respective volumes, so recreating containers does not by itself erase the workspace.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I upgrade without deleting the wiki?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Back up the named volumes first, then run <code>docker compose pull<\/code> and <code>docker compose up -d<\/code> from <code>\/opt\/docmost<\/code>. Do not add <code>-v<\/code> to <code>docker compose down<\/code> or remove the named volumes, because those actions can delete the application data.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Can I run Docmost with only a server IP address?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"You can test the application over plain HTTP, but Caddy cannot obtain a trusted certificate for a bare IP in the normal setup. A DNS name is the practical choice for a secure public deployment and is required by the HTTPS configuration in this guide.\"}}, {\"@type\": \"Question\", \"name\": \"Why are PostgreSQL and Redis separate containers?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Docmost expects PostgreSQL for its application data and Redis for cache and real-time coordination. Keeping them on the private Compose network avoids exposing either service directly to the internet.\"}}, {\"@type\": \"Question\", \"name\": \"Where are Docmost pages and uploads stored?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Pages and uploaded files are stored in the `docmost` named volume. PostgreSQL records, Redis persistence, and Caddy\u2019s certificate state are stored in their respective volumes, so recreating containers does not by itself erase the workspace.\"}}, {\"@type\": \"Question\", \"name\": \"How do I upgrade without deleting the wiki?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Back up the named volumes first, then run `docker compose pull` and `docker compose up -d` from `\/opt\/docmost`. Do not add `-v` to `docker compose down` or remove the named volumes, because those actions can delete the application data.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install Docmost using Docker on Rocky Linux 8 with PostgreSQL, Redis, Caddy HTTPS, firewalld, SELinux-safe mounts, and health checks in 15 minutes.","protected":false},"author":1,"featured_media":1116,"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":[118,138,105,139],"class_list":["post-1115","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-docker","tag-docmost","tag-rocky-linux-8","tag-self-hosting","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1115","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=1115"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1115\/revisions"}],"predecessor-version":[{"id":4095,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1115\/revisions\/4095"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1116"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}