eco Beginner Tutorial/How-to

Installing OpenProject on a VPS: Docker, PostgreSQL, SSL, SMTP, and Backups

We earn commissions when you shop through the links below.

calendar_month Oct 21, 2026 schedule 18 min read visibility 823 views
Установка OpenProject на VPS: Docker, PostgreSQL, SSL, SMTP и резервные копии
dns No server for this guide yet? Vultr, DigitalOcean, Contabo

Installing OpenProject on a VPS: Docker, PostgreSQL, SSL, SMTP, and Backups

TL;DR

In this guide, you will deploy OpenProject on a VPS through Docker Compose: separate application, PostgreSQL, and Redis containers, a Caddy reverse proxy with automatic SSL, SMTP for notifications, and automated database and file backups.

  • A VPS with 2 vCPU, 4 GB RAM, and a 50–80 GB NVMe drive is sufficient for a small team.
  • OpenProject runs in Docker Compose with PostgreSQL 16 and Redis 7.
  • Caddy automatically issues and renews Let's Encrypt certificates.
  • SMTP is required for user invitations, task notifications, and password resets.
  • A backup must include PostgreSQL, the OpenProject attachments directory, and the configuration.
  • Always create a verifiable backup before updating containers.

What we are configuring and why

Diagram: What we are configuring and why
Diagram: What we are configuring and why

OpenProject is a self-hosted project management system with tasks, Kanban boards, Gantt charts, wiki, time tracking, roles, work packages, and integrations. It is a suitable option if a team wants to store projects, discussions, and attachments on its own infrastructure, control backups, and avoid depending on SaaS platform pricing.

As a result, a secure web interface will be available at an address such as https://projects.example.com. Users will be able to receive emails about task assignments, status changes, comments, and invitations. All components will be isolated in Docker containers, making migration to another server, updates, and recovery noticeably easier than with a manual installation of a Ruby application on the system.

Deployment architecture

Component Purpose External access
OpenProject web Web interface, API, request processing Only through Caddy
OpenProject worker Background jobs, email, notifications No
PostgreSQL 16 Main database for projects, users, and tasks No
Redis 7 Queues and background task cache No
Caddy 2 HTTPS, reverse proxy, automatic certificates Ports 80 and 443

Why Docker Compose

Docker Compose makes it possible to keep the infrastructure alongside the configuration in a single directory. All dependencies are described declaratively: image versions, volumes, networks, environment variables, and startup order. If the VPS needs to be replaced, simply install Docker, copy the project directory, restore the data, and run docker compose up -d.

Do not expose the PostgreSQL port externally. In this setup, the database is accessible only to containers on the internal Docker network. This reduces the attack surface and eliminates the need to maintain separate firewall rules for the database.

Self-hosted and cloud service

Criterion Cloud service OpenProject on a VPS
Maintenance The provider updates the platform You manage updates and backups
Data control Data is held by the service operator Data and access keys are under your control
Flexibility Limited by the service plan and policy You can change SMTP, the domain, network, backups, and integrations
Cost Usually depends on the number of users Depends primarily on server resources and backup storage

Self-hosted OpenProject is a good choice for teams that need data control, an internal domain, their own SMTP gateway, or integration with a VPN or local systems. However, this option requires discipline: monitoring available disk space, testing recovery, and performing regular security updates.

What VPS configuration is needed for this task

Diagram: What VPS configuration is needed for this task
Diagram: What VPS configuration is needed for this task

OpenProject consumes noticeably more resources than a simple website: a Ruby application, background workers, PostgreSQL, Redis, and a reverse proxy are running. The main growth factors are the number of active users, the volume of attachments, notification intensity, the number of integrations, and project history.

Scenario vCPU RAM NVMe drive Suitable number of users
Test environment 2 4 GB 50 GB 1–10
Small team 2–4 8 GB 80–160 GB 10–50
Active team 4–6 16 GB 200 GB or more 50–150
High load 8+ 32 GB+ From 500 GB 150+ or many attachments

For the first production deployment for 10–30 employees, a configuration with 4 vCPU, 8 GB RAM, 100 GB NVMe, and a connection of at least 100 Mbps is practical. This capacity will allow PostgreSQL to keep its working cache in memory while OpenProject serves users and background jobs simultaneously. You can choose a VPS with the specified characteristics, but the key is to choose a fast SSD/NVMe drive and the ability to increase resources without migration.

How much disk space to reserve

Plan space not only for the application. PostgreSQL grows along with task history, comments, and audit data, while the attachments directory often takes up more space than the database itself. For an estimate, use the rule: current data volume × 3. One part is needed by the running service, the second for a temporary local backup, and the third as a reserve for updates, logs, and growth.

For example, if users have uploaded 25 GB of files and the database occupies 5 GB, a 50 GB drive is already risky: a single full local archive will almost fill the server. In this case, choose at least 100–160 GB and send backups to external S3-compatible storage or a separate server.

When you need dedicated rather than a VPS

A VPS is suitable for most teams with up to several dozen active employees. A dedicated server makes sense when guaranteed disk and CPU performance is required, the database has become large, the number of concurrent users has grown into the hundreds, or GitLab, CI runners, Nextcloud, and other resource-intensive services are running on the same machine.

You should also move to a dedicated server when there are compliance requirements that require physical isolation, or when PostgreSQL experiences constant input/output delays. Do not try to compensate for insufficient RAM with unlimited swap: under load, this leads to a slow interface and delays in background jobs.

Choosing a location

Location affects latency for employees, requirements for storing personal data, and the speed of transferring attachments. If the team is located in Europe, choose a data center closer to the main users. If OpenProject is used only through a corporate VPN, place the VPS in the same geographic region as the VPN gateway.

A domain name with an A record pointing to the VPS IPv4 address is required for the SSL certificate and public access. Before starting Caddy, create a DNS record, for example projects.example.com, and wait for it to propagate.

Server preparation

Diagram: Server preparation
Diagram: Server preparation

Ubuntu Server 24.04 LTS is used below — a stable version with long-term support, suitable for deployments in 2026. Run commands as a user with sudo privileges. Do not run Docker Compose as root unless necessary: this complicates auditing and increases the risk of accidentally modifying system files.

Updating the system and basic utilities

First, connect to the server over SSH, update the packages, and install utilities for diagnostics, the firewall, and automatic password-guessing protection.

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl ca-certificates gnupg ufw fail2ban jq unzip vim htop ncdu
sudo reboot

The first command installs security updates, the second adds the required tools, and the reboot applies the new kernel and system libraries if they were updated.

Creating a separate user

If the provider gave you only root access, create a separate deploy user. Going forward, this user will manage the OpenProject directory and Docker Compose.

sudo adduser deploy
sudo usermod -aG sudo deploy
sudo mkdir -p /home/deploy/.ssh
sudo chmod 700 /home/deploy/.ssh

Add the public key to the /home/deploy/.ssh/authorized_keys file. The file permissions must be strictly restricted; otherwise, SSH may ignore the key.

sudo nano /home/deploy/.ssh/authorized_keys
sudo chown -R deploy:deploy /home/deploy/.ssh
sudo chmod 600 /home/deploy/.ssh/authorized_keys

Before disabling root access, be sure to open a second SSH connection and confirm that logging in as deploy with the key works. Only after verification should you change the SSH settings.

sudo nano /etc/ssh/sshd_config.d/99-hardening.conf
sudo systemctl reload ssh

Add the following parameters to the created file:

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
KbdInteractiveAuthentication no
X11Forwarding no
AllowUsers deploy

Firewall and fail2ban

Open only SSH, HTTP, and HTTPS. If SSH does not use the standard port, replace the OpenSSH rule with the specific port number.

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose

Fail2ban will monitor failed SSH login attempts and temporarily block IP addresses. On Ubuntu, it is sufficient to enable the service and check its status.

sudo systemctl enable --now fail2ban
sudo fail2ban-client status
sudo fail2ban-client status sshd

Checking DNS before installation

On your computer or on the VPS, check that the domain points to the correct IP. Caddy will not be able to obtain a Let's Encrypt certificate if DNS has not yet updated or port 80 is blocked by the provider panel's external firewall.

dig +short projects.example.com A
curl -4 ifconfig.me
sudo ss -lntp

The first output should match the VPS's public IPv4 address. Before the containers are started, having no processes listening on ports 80 and 443 is normal.

Software Installation — Step by Step

Diagram: Software Installation — Step by Step
Diagram: Software Installation — Step by Step

Docker Engine 27+ and Docker Compose v2 are used for deployment. Images are pinned to the major versions: OpenProject 16, PostgreSQL 16, Redis 7, and Caddy 2. Before a minor update, review the OpenProject changelog and do not use the latest tag in production: it makes updates unpredictable.

Installing Docker Engine

Add the official Docker repository for Ubuntu 24.04. The commands install the engine, CLI, Buildx, and the Docker Compose plugin.

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Add the deploy user to the Docker group. After that, you need to log out of the SSH session and log in again so that the groups are updated.

sudo usermod -aG docker deploy
sudo systemctl enable --now docker
docker --version
docker compose version

Creating the Working Directory

Store compose files and secrets in a directory accessible only to the deploy user. Create a structure for Caddy, backups, and environment variables.

sudo -iu deploy
mkdir -p ~/openproject/{caddy,data,backups}
cd ~/openproject
umask 077
touch .env
chmod 600 .env

Run all subsequent commands as the deploy user. The ~/openproject/data directory will be used for Caddy's persistent files; OpenProject and PostgreSQL data will be stored in Docker volumes.

Generating Secrets

Separate random values are required for the database, Rails, and Redis. Do not use short passwords, dictionary words, or the same secret in all fields.

openssl rand -hex 32
openssl rand -base64 48
openssl rand -base64 32

Copy the results into the .env file. In the example below, replace the domain and SMTP credentials with real values.

nano ~/openproject/.env
OPENPROJECT_HOST=projects.example.com
POSTGRES_DB=openproject
POSTGRES_USER=openproject
POSTGRES_PASSWORD=REPLACE_WITH_LONG_DATABASE_PASSWORD
OPENPROJECT_SECRET_KEY_BASE=REPLACE_WITH_LONG_RAILS_SECRET
REDIS_PASSWORD=REPLACE_WITH_LONG_REDIS_PASSWORD

SMTP_ADDRESS=smtp.example.com
SMTP_PORT=587
SMTP_DOMAIN=example.com
[email protected]
SMTP_PASSWORD=REPLACE_WITH_SMTP_PASSWORD
SMTP_FROM=OpenProject <[email protected]>

Creating the Docker Compose File

The following file creates an internal network for the application, database, and Redis. Only the Caddy ports are published externally. OpenProject containers use the same image but perform different roles: web server and queue processor.

nano ~/openproject/compose.yml
services:
  db:
    image: postgres:16-alpine
    container_name: openproject-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 10
    networks:
      - backend

  redis:
    image: redis:7-alpine
    container_name: openproject-redis
    restart: unless-stopped
    command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
    volumes:
      - redisdata:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli -a \"$${REDIS_PASSWORD}\" ping | grep PONG"]
      interval: 10s
      timeout: 5s
      retries: 10
    environment:
      REDIS_PASSWORD: ${REDIS_PASSWORD}
    networks:
      - backend

  web:
    image: openproject/openproject:16
    container_name: openproject-web
    restart: unless-stopped
    command: "./docker/prod/web"
    env_file: .env
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
      OPENPROJECT_HOST__NAME: ${OPENPROJECT_HOST}
      OPENPROJECT_HTTPS: "true"
      OPENPROJECT_HSTS: "true"
      OPENPROJECT_SECRET_KEY_BASE: ${OPENPROJECT_SECRET_KEY_BASE}
      OPENPROJECT_CACHE__MEMCACHE__SERVER: redis:6379
      OPENPROJECT_EMAIL__DELIVERY__METHOD: smtp
      OPENPROJECT_SMTP__ADDRESS: ${SMTP_ADDRESS}
      OPENPROJECT_SMTP__PORT: ${SMTP_PORT}
      OPENPROJECT_SMTP__DOMAIN: ${SMTP_DOMAIN}
      OPENPROJECT_SMTP__AUTHENTICATION: login
      OPENPROJECT_SMTP__USER_NAME: ${SMTP_USERNAME}
      OPENPROJECT_SMTP__PASSWORD: ${SMTP_PASSWORD}
      OPENPROJECT_SMTP__ENABLE_STARTTLS_AUTO: "true"
      OPENPROJECT_EMAIL__FROM: ${SMTP_FROM}
    volumes:
      - opdata:/var/openproject/assets
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    networks:
      - backend
      - proxy

  worker:
    image: openproject/openproject:16
    container_name: openproject-worker
    restart: unless-stopped
    command: "./docker/prod/worker"
    env_file: .env
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
      OPENPROJECT_HOST__NAME: ${OPENPROJECT_HOST}
      OPENPROJECT_HTTPS: "true"
      OPENPROJECT_SECRET_KEY_BASE: ${OPENPROJECT_SECRET_KEY_BASE}
      OPENPROJECT_CACHE__MEMCACHE__SERVER: redis:6379
      OPENPROJECT_EMAIL__DELIVERY__METHOD: smtp
      OPENPROJECT_SMTP__ADDRESS: ${SMTP_ADDRESS}
      OPENPROJECT_SMTP__PORT: ${SMTP_PORT}
      OPENPROJECT_SMTP__DOMAIN: ${SMTP_DOMAIN}
      OPENPROJECT_SMTP__AUTHENTICATION: login
      OPENPROJECT_SMTP__USER_NAME: ${SMTP_USERNAME}
      OPENPROJECT_SMTP__PASSWORD: ${SMTP_PASSWORD}
      OPENPROJECT_SMTP__ENABLE_STARTTLS_AUTO: "true"
      OPENPROJECT_EMAIL__FROM: ${SMTP_FROM}
    volumes:
      - opdata:/var/openproject/assets
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    networks:
      - backend

  caddy:
    image: caddy:2-alpine
    container_name: openproject-caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    environment:
      OPENPROJECT_HOST: ${OPENPROJECT_HOST}
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - caddydata:/data
      - caddyconfig:/config
    depends_on:
      - web
    networks:
      - proxy

volumes:
  pgdata:
  redisdata:
  opdata:
  caddydata:
  caddyconfig:

networks:
  backend:
    internal: true
  proxy:

The internal: true parameter prevents containers in the backend network from making direct external connections. Caddy is simultaneously in the proxy network and can forward requests to the web container.

Checking the Syntax and Starting

Docker Compose will substitute values from the .env file, but do not output the final configuration to public logs: it will contain passwords. First download the images, then start the stack in the background.

cd ~/openproject
docker compose config --quiet
docker compose pull
docker compose up -d
docker compose ps

The first startup may take several minutes: OpenProject prepares the database and runs migrations. Monitor the logs until the web application reports that it is ready to accept requests.

docker compose logs -f web
docker compose logs -f worker
docker compose ps

OpenProject, SSL, and SMTP Configuration

Diagram: OpenProject, SSL, and SMTP Configuration
Diagram: OpenProject, SSL, and SMTP Configuration

Configuring Caddy and HTTPS

Caddy automatically requests a Let's Encrypt certificate, redirects HTTP to HTTPS, and renews the certificate. For this, the domain's DNS record must point to the server, and ports 80 and 443 must be open both in UFW and in the VPS panel's network firewall.

nano ~/openproject/caddy/Caddyfile
{$OPENPROJECT_HOST} {
    encode zstd gzip

    reverse_proxy web:8080 {
        header_up Host {host}
        header_up X-Real-IP {remote_host}
        header_up X-Forwarded-For {remote_host}
        header_up X-Forwarded-Proto {scheme}
    }

    log {
        output stdout
        format console
    }
}

After saving, restart only Caddy. During the first few minutes, it will obtain the certificate and save it in the persistent Docker volume caddydata.

cd ~/openproject
docker compose up -d caddy
docker compose logs -f caddy

If the certificate is not issued, do not disable HTTPS in OpenProject. First check DNS, open ports, and whether another process has already occupied port 80 or 443.

Checking the Web Interface

After a successful startup, open https://projects.example.com in your browser. On the first screen, OpenProject will offer to create an administrator. Use a unique, long password and save it in a password manager.

From the server, check the HTTP response, TLS, and container status. A 200, 302, or login page indicates that the proxy is working. 502 errors usually indicate a problem with the web container.

curl -I http://projects.example.com
curl -Ik https://projects.example.com
docker compose ps
docker stats --no-stream

Checking PostgreSQL and Redis

There is no need to expose PostgreSQL externally for testing. Use commands inside the Docker network. They will show that the database accepts connections and Redis responds to requests.

docker compose exec db pg_isready -U openproject -d openproject
docker compose exec db psql -U openproject -d openproject -c "SELECT version();"
docker compose exec redis redis-cli -a "$REDIS_PASSWORD" ping

The last command is run from a shell where the variable from .env is available. If you opened a new session, first navigate to the project directory and load the variables with the command set -a; . ./.env; set +a.

SMTP for Notifications

OpenProject uses SMTP for invitations, reminders, task notifications, and access recovery. Without properly configured outgoing mail, users will be able to work in the interface but will not receive important events by email.

In the .env file, use an SMTP user authorized to send from the address specified in SMTP_FROM. Port 587 and STARTTLS are suitable for most external providers. Port 465 usually requires SSL from the start of the connection and may require separate configuration, so choose 587 for the initial setup if possible.

After changing the SMTP variables, apply the configuration by restarting web and worker. Then open the administrative mail settings in the web interface and send a test message to a personal address.

cd ~/openproject
docker compose up -d --force-recreate web worker
docker compose logs --tail=100 worker
docker compose logs --tail=100 web

If mail is not being sent, look in the logs for authentication, TLS, or DNS errors. Do not insert the SMTP password into the command line: it will remain in the shell history. Store it only in .env with 600 permissions.

Basic Settings After the First Login

  1. Create a separate administrator account for everyday work, and store the emergency admin account separately.
  2. Check the installation URL in the administrative settings to ensure that links in emails point to the HTTPS domain.
  3. Create roles: administrator, project manager, member, observer, and external client.
  4. Configure required task fields, work package types, and statuses according to the team's workflow.
  5. Restrict self-registration if the system is intended only for an internal team.

Do not store secrets in compose.yml or add the .env file to a Git repository. Losing OPENPROJECT_SECRET_KEY_BASE may complicate the recovery of sessions and encrypted data, so it must be included in a protected configuration backup.

Backups and maintenance

Diagram: Backups and maintenance
Diagram: Backups and maintenance

A working OpenProject without a backup is a temporary installation. Complete recovery requires more than just PostgreSQL data. You need to preserve user attachments, secrets from .env, the compose file, Caddyfile, and Caddy data containing certificates and service information.

What exactly to back up

Data Location Criticality
OpenProject database Docker volume pgdata Critical
Attachments and assets Docker volume opdata Critical
Secrets and configuration ~/openproject/.env, compose.yml, Caddyfile Critical
Caddy certificates Docker volume caddydata Recommended
Redis Docker volume redisdata Optional, but useful

For PostgreSQL, use a logical dump with pg_dump, rather than simply copying files from a running database. A logical dump can be restored on a new host version and checked separately. For Docker volumes containing attachments, use an archive created through a temporary Alpine container.

Local backup script

Create a script that dumps the database and archives the attachments volume and configuration. The script keeps local copies for seven days; this is insufficient as the only protection, so uploading to external storage is added below.

mkdir -p ~/openproject/scripts
nano ~/openproject/scripts/backup.sh
chmod 700 ~/openproject/scripts/backup.sh
#!/usr/bin/env bash
set -euo pipefail

BASE_DIR="$HOME/openproject"
BACKUP_DIR="$BASE_DIR/backups"
DATE="$(date +%F_%H-%M-%S)"
ARCHIVE="$BACKUP_DIR/$DATE"

mkdir -p "$ARCHIVE"
cd "$BASE_DIR"

set -a
. ./.env
set +a

docker compose exec -T db pg_dump \
  -U "$POSTGRES_USER" \
  -d "$POSTGRES_DB" \
  --format=custom \
  --file=/tmp/openproject.dump

docker cp openproject-db:/tmp/openproject.dump "$ARCHIVE/openproject.dump"
docker compose exec -T db rm -f /tmp/openproject.dump

docker run --rm \
  -v openproject_opdata:/source:ro \
  -v "$ARCHIVE":/backup \
  alpine:3.20 \
  tar czf /backup/opdata.tar.gz -C /source .

tar czf "$ARCHIVE/config.tar.gz" \
  .env compose.yml caddy/Caddyfile scripts/backup.sh

sha256sum "$ARCHIVE"/ > "$ARCHIVE/SHA256SUMS"
find "$BACKUP_DIR" -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

echo "Backup completed: $ARCHIVE"

Before automating it, run the script manually. Check the file sizes: the database dump must not be empty, and the opdata.tar.gz archive should contain attachments if any already exist.

~/openproject/scripts/backup.sh
ls -lh ~/openproject/backups/$(date +%F)
cat ~/openproject/backups/$(date +%F)/SHA256SUMS

Sending backups to S3 via restic

A local copy will not help if the VPS is deleted, the disk fails, or the server is compromised. Keep a second copy in separate S3-compatible storage, another data center, or on a separate server. Restic encrypts data on the client side before uploading it.

sudo apt install -y restic
mkdir -p ~/.config/restic
chmod 700 ~/.config/restic
nano ~/.config/restic/openproject.env
chmod 600 ~/.config/restic/openproject.env
RESTIC_REPOSITORY=s3:https://s3.example.com/openproject-backups
RESTIC_PASSWORD=REPLACE_WITH_LONG_RESTIC_REPOSITORY_PASSWORD
AWS_ACCESS_KEY_ID=REPLACE_WITH_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=REPLACE_WITH_SECRET_KEY

Initialize the repository once, then add the upload commands to the end of the script after creating the checksums.

set -a
. ~/.config/restic/openproject.env
set +a
restic init

Add the following commands to backup.sh before the echo line:

set -a
. "$HOME/.config/restic/openproject.env"
set +a
restic backup "$ARCHIVE"
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune

Automatic execution via cron

Run the backup at night, for example at 03:30. Cron redirects the output to a log so you can quickly identify an upload error or insufficient space.

crontab -e
30 3    /home/deploy/openproject/scripts/backup.sh >> /home/deploy/openproject/backups/backup.log 2>&1

Once a month, check the repository and perform a test restoration on a separate machine or in a separate directory. A backup is considered valid only after a successful restoration.

set -a
. ~/.config/restic/openproject.env
set +a
restic snapshots
restic check
restic restore latest --target /tmp/openproject-restore-test

OpenProject and infrastructure updates

For a small team, it is better to perform updates during a maintenance window. OpenProject may apply database migrations, so do not update containers in the middle of the workday. First read the release notes, create a backup, then download the image and restart the services.

cd ~/openproject
./scripts/backup.sh
docker compose pull
docker compose up -d
docker compose logs --tail=100 web
docker compose ps

Rolling updates with multiple web containers make sense only with a separate load balancer, external PostgreSQL, and a tested migration scheme. For a single VPS, a short maintenance window is more appropriate: notify the team, update the stack, and check login, task creation, an attachment, and a test email.

Check disk status, memory consumption, and Docker object sizes weekly. Do not blindly run docker system prune -a: the command may delete images needed for a quick rollback. Remove only unused images after reviewing the list.

df -h
free -h
docker system df
docker compose logs --since=24h --tail=200 web
sudo journalctl -u docker --since "24 hours ago"

Troubleshooting + FAQ

Why does Caddy return an error when obtaining an SSL certificate?

First check that the domain's A record points to the VPS's public IPv4 address: dig +short projects.example.com. Then make sure ports 80 and 443 are allowed in UFW and in the network security panel. The error also occurs if another process is already listening on port 80: check this with sudo ss -lntp '( sport = :80 or sport = :443 )'. After fixing the issue, restart Caddy with docker compose restart caddy.

Why does the site return 502 Bad Gateway?

A 502 code means that Caddy is accessible but cannot connect to the OpenProject container. Run docker compose ps and make sure the openproject-web container has an Up status. Then view the latest logs: docker compose logs --tail=150 web. Common causes include an unsuccessful database migration, an error in the DATABASE_URL variable, insufficient memory, or an unhealthy PostgreSQL instance. Fix the underlying error and run docker compose up -d.

OpenProject keeps restarting after launch. What should I do?

First check the cause with docker compose logs --tail=200 web and docker compose logs --tail=200 worker. If the logs contain OOMKilled, the VPS lacks memory: for production, use at least 4 GB of RAM, or preferably 8 GB. If the error is database-related, check docker compose logs db and the pg_isready status. Also make sure that OPENPROJECT_SECRET_KEY_BASE is not empty and does not change between restarts.

Why are emails not being sent through SMTP?

Check the web and worker logs: authentication errors usually contain 535, while TLS errors mention a certificate or handshake. For most SMTP providers, use port 587, OPENPROJECT_SMTP__ENABLE_STARTTLS_AUTO=true, and an app password instead of the account's main password. Make sure the SMTP_FROM address is authorized by the provider. After editing .env, recreate the web and worker containers with the --force-recreate flag.

What is the minimum suitable VPS configuration?

For testing or a team of up to ten people, the minimum is a VPS with 2 vCPUs, 4 GB of RAM, and a 50 GB SSD/NVMe. It is suitable for a small number of attachments and moderate activity. For a real working team, it is better to choose 4 vCPUs, 8 GB of RAM, and 80–100 GB of NVMe from the start: PostgreSQL gets more cache, background tasks do not interfere with the web interface, and there is room on the disk for temporary backups. Do not economize on disk speed.

What should I choose—VPS or dedicated for this task?

A VPS is sufficient for most OpenProject installations: it is cheaper, scales faster, and is well suited to teams of up to several dozen users. A dedicated server is needed with hundreds of active users, large file volumes, high PostgreSQL load, strict physical isolation requirements, or if heavy services run on the same machine. A practical approach is to start with a VPS with sufficient RAM and disk capacity, measure the load, and migrate only when truly necessary.

How do I restore OpenProject from a backup?

On the new server, deploy Docker and the same compose configuration directory, but do not start OpenProject until the data has been restored. Create the volumes with docker compose up -d db redis, import the dump using pg_restore into the PostgreSQL container, and extract opdata.tar.gz into the Docker volume openproject_opdata. Restore the original .env file, especially the Rails secret, then start the entire stack and check login, projects, and attachments.

The disk is filling up quickly. What data can be deleted?

First determine the source of the growth: df -h, docker system df, du -sh ~/openproject/backups, and docker volume ls. Most often, local backups, user attachments, or container logs consume the space. Reduce the retention period for local archives only after successfully uploading them to external storage. Do not delete PostgreSQL or OpenProject Docker volumes manually: this will destroy working data. Configure Docker log rotation and monitor sizes.

Conclusions and next steps

Diagram: Conclusions and next steps
Diagram: Conclusions and next steps

OpenProject now runs on a VPS in Docker Compose, uses PostgreSQL and Redis, is accessible via HTTPS through Caddy, sends notifications through SMTP, and has automated backups. This setup is suitable for a small to medium-sized team and allows you to control data, updates, and recovery.

  1. Test restoring the latest backup on a separate server or in an isolated Docker environment.
  2. Set up monitoring for CPU, RAM, free space, HTTPS availability, and backup status.
  3. As the team grows, move PostgreSQL to a separate server, add external S3 for attachments, and prepare a plan for updates without extended downtime.

Affiliate links: we may earn a commission, your price stays the same.

Was this guide helpful?

Your feedback helps us improve our guides.

Share this post:

Send this guide to someone who may find it useful.

Telegram VKVK WhatsApp Facebook LinkedIn XX

installing OpenProject on a VPS: Docker, PostgreSQL, SSL, SMTP, and backups