Skip to content

CleverCloud/docmost-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clever Cloud logo

Docmost on Clever Cloud

Docmost – Open-source collaborative wiki & documentation Clever Cloud - PaaS

Overview

This repository provides a complete guide for deploying Docmost - an open-source collaborative wiki and documentation platform - on Clever Cloud, a European PaaS provider.

Docmost is an open-source alternative to Confluence and Notion that helps teams create, collaborate on, and share knowledge with real-time editing, spaces, and a clean interface. By deploying on Clever Cloud, you get a reliable, scalable hosting solution with minimal maintenance overhead.

Prerequisites

  • A Clever Cloud account
  • Clever Tools CLI installed and configured
  • Basic familiarity with command line operations
  • A domain name (optional, but recommended for production use)

Unlike some other wikis, Docmost ships with built-in email/password authentication, so no external OAuth provider is required to get started. Configuring SMTP is optional but recommended (see Email Setup) for invitations and password resets.

Architecture

This deployment consists of the following components:

  • Docmost application: A Node.js monorepo (Nest.js backend + React/Vite frontend), built with pnpm and nx
  • PostgreSQL database: Stores all wiki content, users, spaces, and metadata
  • Redis cache: Handles sessions, caching, and real-time collaboration
  • File storage: Clever Cloud S3-compatible (Cellar) bucket for attachments and images

Deployment Guide

Before You Begin

Before starting the deployment process, you'll need to define the following values:

  • <ORGANISATION> with the name of your organisation where the Docmost instance will be deployed
  • <APP_NAME> with your chosen application name
  • <YOUR_DOMAIN_NAME> with your domain name (if applicable)

The APP_SECRET used to sign sessions is generated automatically with openssl rand -hex 32 in the steps below.

Email Setup

Docmost uses its own email/password authentication. The first user to register creates the workspace and becomes the admin, so you can sign in right away without any external provider.

To invite teammates and enable password resets, configure an SMTP server (any provider works). This is optional for a first run but recommended for production - see the Email configuration at the end of the deployment script.

Important Notes

Versions

In this example we deploy a tagged release of Docmost, currently v0.90.1. Docmost's default branch, main, is considered in development and may be broken at any time, so always use a release tag to deploy a stable version.

Package manager & Node version

Docmost is a pnpm + nx monorepo and requires Node.js >= 22. Clever Cloud automatically detects pnpm from the pnpm-lock.yaml file at the root of the project and uses the version pinned in the packageManager field of package.json, so there is nothing extra to configure for the build tool. We set CC_NODE_VERSION explicitly to make sure a compatible Node version is used.

Database & Redis versions

Docmost requires PostgreSQL >= 16 and Redis/Valkey >= 7. When creating the add-ons, make sure to pick a plan/version that satisfies these requirements.

Migrations

Docmost runs its database migrations automatically on startup when NODE_ENV=production. There is therefore no separate migration step in the build hook - migrations are applied the first time the application boots.

Using Clever Tools CLI

Follow these steps to deploy Docmost on Clever Cloud using the command line:

# Step 0: Prepare the environment

export APP_NAME=<APP_NAME>
export ORGANISATION=<ORGANISATION>

# Optional: Define your domain
export CC_DOMAIN=<YOUR_DOMAIN_NAME>

# Get the chosen release of Docmost
wget https://github.com/docmost/docmost/archive/refs/tags/v0.90.1.tar.gz

# Extract the release in the current folder
tar -xvzf v0.90.1.tar.gz --strip-components=1

# Re-initialize the git repository
git init
git add .
git commit -m "Initial commit"

# Step 1: Create a Node application
clever create --type node $APP_NAME --org $ORGANISATION
# The nx + Vite monorepo build is memory intensive, an M flavor is recommended
clever scale --app $APP_NAME --flavor M

# Add your domain
if [ -n "$CC_DOMAIN" ]; then
clever domain add $CC_DOMAIN
fi

# Step 2: Create required add-ons
# - PostgreSQL database for data storage (PostgreSQL >= 16)
clever addon create postgresql-addon --plan xxs_sml $APP_NAME-pg --org $ORGANISATION
# - Redis for session storage, caching and real-time collaboration (Redis >= 7)
clever addon create redis-addon --plan s_mono $APP_NAME-redis --org $ORGANISATION
# - S3 bucket (Cellar) for file uploads
clever addon create cellar-addon $APP_NAME-s3 --org $ORGANISATION

# Step 3: Link add-ons to your application
clever service link-addon $APP_NAME-pg
clever service link-addon $APP_NAME-redis
clever service link-addon $APP_NAME-s3

# Step 4: Configure environment variables
eval "$(clever env -F shell --alias $APP_NAME)"
export APP_ID=`clever applications -j | jq -r ".[0].app_id"`
: "${CC_DOMAIN=`clever curl -s https://api.clever-cloud.com/v2/self/applications/$APP_ID | jq -r ".vhosts[0].fqdn"`}"

clever env set APP_URL https://$CC_DOMAIN
echo "Domain $CC_DOMAIN"

# Common environment variables
clever env set NODE_ENV production
clever env set PORT 8080
clever env set CC_NODE_VERSION 22
# Keep dev dependencies so the monorepo can be built
clever env set CC_NODE_DEV_DEPENDENCIES install
# Build the whole monorepo (nx builds the editor extension, backend and frontend in order)
clever env set CC_POST_BUILD_HOOK "pnpm build"
# Start the production server (migrations run automatically on boot in production)
clever env set CC_RUN_COMMAND "pnpm start"
# Secret used to sign sessions and tokens
clever env set APP_SECRET $( openssl rand -hex 32 )

# Database configuration
clever env set DATABASE_URL $POSTGRESQL_ADDON_URI

# Redis configuration (automatically set from Redis add-on)
clever env set REDIS_URL $REDIS_URL

# File storage configuration (S3-compatible Cellar bucket)
export BUCKET_NAME=$(clever applications -j | jq -r '.[0].app_id' | tr '_' '-')-docmost
clever env set STORAGE_DRIVER s3
clever env set AWS_S3_ENDPOINT https://${CELLAR_ADDON_HOST}
clever env set AWS_S3_BUCKET $BUCKET_NAME
clever env set AWS_S3_ACCESS_KEY_ID $CELLAR_ADDON_KEY_ID
clever env set AWS_S3_SECRET_ACCESS_KEY $CELLAR_ADDON_KEY_SECRET
clever env set AWS_S3_FORCE_PATH_STYLE true
clever env set AWS_S3_REGION us-east-1

# S3 initialisation (creates the bucket, CORS and policy)
./configure-cellar.sh

# Optional: Email/SMTP configuration for invitations and password resets
# clever env set MAIL_DRIVER smtp
# clever env set SMTP_HOST '<YOUR_SMTP_HOST>'
# clever env set SMTP_PORT '<YOUR_SMTP_PORT>'
# clever env set SMTP_USERNAME '<YOUR_SMTP_USERNAME>'
# clever env set SMTP_PASSWORD '<YOUR_SMTP_PASSWORD>'
# clever env set SMTP_SECURE true
# clever env set MAIL_FROM_ADDRESS '<YOUR_FROM_EMAIL>'
# clever env set MAIL_FROM_NAME 'Docmost'

Deployment

After configuring all the environment variables, deploy your application:

# Push your code to Clever Cloud
clever deploy

Post-Deployment

  1. Once deployed, access your Docmost instance at https://<YOUR_DOMAIN_NAME>/
  2. Create the first account - this user creates the workspace and automatically becomes the admin
  3. Invite your teammates (requires SMTP to be configured) and start building your team's knowledge base!

Contributing

Contributions to improve this deployment example are welcome! Please feel free to submit pull requests or open issues for any enhancements or bug fixes.

License

This example is provided under the terms of the MIT license.

About

Docmost on Clever Cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages