Redmine with Docker Compose and PostgreSQL: when this stack fits
This stack runs Redmine in one container and PostgreSQL in a separate container, wired together by Docker Compose, with persistent volumes for the database and uploaded files and a reverse proxy in front for HTTPS. It fits a team that already operates Docker hosts, wants the application and database versioned as code, and is comfortable owning the container lifecycle, backups and upgrades. If your organization runs Linux servers under a configuration tool and prefers packages or systemd units, a host install with Puma and Nginx is the other common option, and the choice is mostly about how your team operates services rather than about Redmine's features.
Redmine is free software released under the GNU General Public License v2 and has no paid edition, so the cost of this stack does not come from a license fee. It comes from the hosts and storage you provide, the implementation work to configure and harden the stack, plugins and their upgrades, and the people who patch, back up and test it over time. Ask any partner to price these components separately in a written scope so you can see which parts recur every year and which are one-time work.
Check the PostgreSQL version before you pin the database image. The supported major versions are 18 (final release November 14, 2030), 17 (to November 8, 2029), 16 (to November 9, 2028), 15 (to November 11, 2027) and 14 (to November 12, 2026). Versions 13 and earlier are unsupported. Confirm which Redmine release line you will run against the Redmine download page and the PostgreSQL versioning policy, because the database you choose now sets the date by which you must plan a major upgrade.
How the Redmine, PostgreSQL and proxy containers connect
The diagram starts at the TLS reverse proxy on the edge, which is the only service that accepts traffic from users. It forwards requests over an internal Compose network to the Redmine application container, which talks to the PostgreSQL container on that same private network. Redmine stores attachments in a named files volume, and PostgreSQL keeps its data in a separate named volume. The backup job sits outside the containers and reads from the database and files volumes. Check that PostgreSQL publishes no host port and that the backup job runs on a schedule you have tested with a restore.
Traffic enters at the proxy, and only the proxy crosses into the internal network.
Compose options and when each fits
This table compares the main choices in a Redmine and PostgreSQL Compose stack and states when each fits and what it trades off. Read each row as a decision: pick the option that matches your upgrade cadence, secret handling, recovery needs and existing edge infrastructure.
| Decision | Option | When it fits | Trade-off |
|---|---|---|---|
| Redmine image tag | Pinned 7.0.x tag from the Docker Official Image | Production stacks that want the fully supported line with security updates | Pinning means you must schedule each patch update and check plugin compatibility before pulling a new tag |
| Redmine image tag | Floating major tag such as latest | Test or lab stacks where drift is acceptable | An automatic pull can move a running instance across a major version without a planned upgrade and backup |
| PostgreSQL image tag | Tag for a supported major version such as 17 or 16 | Stacks that need a database line with a published end-of-support date you can plan around | Major versions need a planned dump, restore or pg_upgrade step; the image tag alone does not migrate data |
| PostgreSQL image tag | Unpinned or unsupported major version | Almost none in production | Older majors lose upstream fixes, and the tag can change under the volume if it is not pinned |
| Database and file storage | Named volumes | Teams that let Docker manage storage on one host and back up through container tools | Data sits in Docker's storage area, so backup and restore steps must run through the container engine |
| Database and file storage | Bind mounts to host directories | Teams that want files at fixed host paths for backup agents, quotas or snapshots | Host ownership and permissions must match the container user, and paths become part of the host configuration |
| Secrets | Plain environment variables | Lab stacks and quick evaluations only | Values appear in docker inspect output and process environments, and are easy to commit to version control by accident |
| Secrets | _FILE variants read from mounted secret files | Production stacks where secrets should stay out of the compose file and environment listings | Files need correct permissions and a rotation procedure; a missed restart leaves the old value in use |
| Healthcheck | Command check against the application's HTTP port | Confirming Redmine answers requests before the proxy routes traffic to it | A running web process can still fail on database access, so pair it with a database check |
| Healthcheck | Database readiness check with pg_isready | Ordering startup so Redmine waits for PostgreSQL to accept connections | It only shows that the server accepts connections, not that the Redmine schema is migrated |
| Reverse proxy | Bundled Nginx or Caddy container in the same stack | Single-host deployments where the stack owns TLS termination and routing | The proxy becomes another component to patch, certificate-manage and monitor inside the stack |
| Reverse proxy | Existing enterprise load balancer or ingress outside the stack | Organizations with central certificate, WAF and logging standards | Requires agreement on headers, upload size limits and the internal network path to the Redmine container |
Build the stack in order, with a check after each step
This sequence brings up PostgreSQL, Redmine and the reverse proxy in dependency order, so each layer is proven before the next one depends on it. The result is a Compose stack that serves Redmine over HTTPS with a working database, files volume and email path.
Write the Compose file with fixed service layout
The platform engineer defines three services: postgres, redmine and a reverse proxy, with a dedicated internal network so the database is reachable only by Redmine. Pin image tags to the Redmine line your team has chosen and to a PostgreSQL major version that is still supported, and check the database and environment settings against the official Redmine installation guide before writing them. Done when
docker compose configrenders the file without errors and shows no published port on postgres.Create secret files outside the repository
Create one file each for the PostgreSQL password and the Redmine secret key base, store them on the host with restricted permissions, and reference them with the _FILE variables described in the Redmine Docker documentation rather than placing values in the Compose file. Keep these files out of version control and record who holds a copy. Done when
docker compose configshows the secret paths and no plaintext password appears in the rendered output or in the repository history.Start PostgreSQL first and wait for healthy
Start only the database service so its data volume is initialized before Redmine exists. Add a healthcheck that runs the PostgreSQL readiness tool against the database name and user, and use a depends_on condition so Redmine waits for it. Done when
docker compose psshows the postgres container as healthy anddocker compose logs postgresends with the server ready to accept connections.Confirm the database accepts connections
Open a shell in the database container and run a simple query as the Redmine role, then confirm that the connection is accepted with the password from the secret file and not with trust authentication. Check that the database volume is mounted at the expected data path on the host. Done when the query returns a result, the role can create and drop a test table in the Redmine database, and the test table is removed afterward.
Start Redmine and run the database migration
Start the Redmine service and let it connect to PostgreSQL over the internal network. Confirm that the schema migrations complete in the container logs, that the files volume is mounted for attachments, and that the application server listens without errors. Done when the logs show migrations finished,
docker compose psshows redmine running, and an HTTP request from inside the network returns the Redmine login page.Add the reverse proxy with HTTPS
Add the proxy service as the only container with published ports, terminate TLS there with a certificate your organization issues or approves, and forward requests to Redmine on the internal network. Set the proxy's request body size limit so attachment uploads are not rejected early, and pass the original host and protocol headers that Redmine uses to build links. Done when the site loads over HTTPS with a valid certificate chain, plain HTTP redirects to HTTPS, and Redmine no longer publishes its own port on the host.
Verify login, attachment upload and email links
Sign in as a test user, create an issue with an attachment, and open the attachment from the issue page to confirm it was written to the files volume. Trigger a notification and check that the links in the email point to the public HTTPS address rather than an internal name. Done when the login succeeds, the attachment downloads after a container restart, and the email link resolves correctly. Record these results as the baseline for the first backup test.
How volumes, secrets and SECRET_KEY_BASE protect data across container restarts
Two kinds of data must outlive a container: the PostgreSQL data directory and the Redmine files directory that holds attachments. Both should sit on named volumes or bind mounts that are declared separately from the containers, so that recreating a container with a new image does not discard issues, wiki pages or uploaded files. Keep the PostgreSQL volume and the Redmine files volume as distinct mounts with clear names, and record exactly which host path or volume backs each one. That mapping is what your backup job, your restore runbook and any later move to a new host will depend on. Confirm the mount target for the files directory against the current Docker Official Image documentation before you write the Compose file, because the path inside the container is what Redmine reads.
The SECRET_KEY_BASE value signs and encrypts the session cookies that Redmine issues. If it changes between restarts, every logged-in user is signed out, and if it differs between two Redmine containers behind one load balancer, sessions created on one replica fail on the other. Generate the value once, store it in your secrets store, and pass it to every Redmine container through the same mechanism. Do not regenerate it as part of a routine image update. Treat it as a credential: anyone holding it can forge session data, so it belongs in the same access-controlled store as the database password.
Secrets should reach the containers at runtime, not through the image or the Compose file. Do not place the database password or SECRET_KEY_BASE in a Dockerfile, in an environment: block with literal values, or in a .env file committed to Git. Docker Compose can mount files as secrets, and the Redmine and PostgreSQL images accept _FILE variants of their settings that read a value from a mounted file. Confirm which _FILE variables your chosen image tag supports, and check that the secret files are readable by the container user but not world-readable on the host. Keep a record of who can read the secrets directory, because that list is part of your access review.
Security settings for a containerized Redmine and PostgreSQL pair
Redmine and PostgreSQL hold issue history, user accounts and uploaded files, so the Compose stack needs deliberate boundaries around each service. The cards below cover network exposure, database privileges, TLS at the edge, secret handling, patching and the Docker host itself, and they are meant to be checked together rather than one at a time.
Keep PostgreSQL off the host network
Do not publish the database port with a ports entry in the Compose file. Attach Redmine and PostgreSQL to a dedicated internal network so only the application can reach the database, and confirm with docker compose ps and a port scan from another host that 5432 is not reachable from outside. Review the file whenever a new service is added to the same project.
Give Redmine a least-privilege database role
Create a dedicated PostgreSQL role for Redmine that owns only the Redmine database, and do not run the application as the superuser set by the postgres image variables. Ask the team who needs the administrator password, and store it outside the application environment so routine restarts do not expose it. Confirm that backup jobs use their own read role.
Terminate HTTPS at the reverse proxy
Let the proxy handle TLS certificates and redirect plain HTTP, and forward only the headers Redmine needs, such as X-Forwarded-Proto and X-Forwarded-For. Set the trusted proxy addresses so that login and audit records show client addresses correctly. Check that Redmine is not reachable on its container port directly from the network.
Restrict permissions on secret files
Keep database passwords and SECRET_KEY_BASE in Docker secrets or files mounted with the _FILE variables, not in plain environment blocks that appear in docker inspect output. Set file owner and mode so only the container user can read them, and rotate the values through a planned change. Ask who holds copies and where those copies are stored.
Pin images and patch on a schedule
Pin Redmine and PostgreSQL to specific tags rather than floating tags, and record the digest you deployed. Redmine 7.0.x is the fully supported line, while 6.1.x receives only bug fixes and security updates, so decide which line you run and who watches its advisories. Confirm the PostgreSQL minor version against the supported list before each planned restart.
Control access to the Docker host
Anyone who can run Docker commands can read every container's mounts, secrets and volumes, so limit SSH accounts and the docker group to named administrators. Keep the host patched, log administrative sessions, and store volume backups on a separate system. Ask your team who can reach the host and whether those actions are logged.
How backups fit around the containers
A database dump and the files volume must be captured as a pair, because Redmine stores issue data in PostgreSQL but keeps attachments on disk in the files volume. A dump taken on Monday with a files copy from Friday restores an issue whose attachment is missing, or an attachment with no matching record. Plan one backup job that produces both artifacts for the same point in time, and record which volume and database names it covers. Run the backup from outside the containers, on the host or from a sidecar container that mounts the database and files volumes read-only. Either way, the backup process needs access to the volumes and the Compose project name must be stable, because Compose prefixes volume names with the project name and a renamed project can leave a backup job pointing at an empty volume.
PostgreSQL continuous archiving and point-in-time recovery is the documented basis for recovering the database to a moment between full backups. It combines a base backup with archived write-ahead log (WAL) segments. Using it from a container means the archive directory must live on storage outside the PostgreSQL container, and the archive command must succeed, or the server keeps WAL files and the disk fills. Confirm with your PostgreSQL image and version that the archive settings can be applied and that the archive location is reachable from the database container. Simple periodic dumps with pg_dump are easier to run and verify, but they only recover to the time of the dump. Choose the approach that matches the recovery point your organization needs, and document it.
The Redmine upgrade guide asks for a backup of the database and uploaded files before any upgrade, so the backup job is also your upgrade safety net. Test restores into a separate Compose project on a different host or with different project names, then start Redmine against the restored volumes and confirm that a sample of issues, attachments and users loads correctly. A backup that has never been restored is an assumption, not a control. Record the restore steps, the owner of each step, and the last successful test in your operations runbook, and retest after each Redmine or PostgreSQL version change.
Limits to confirm in your environment before going live
A Compose stack for Redmine and PostgreSQL is quick to start, but several things look settled when they are not. The cards below list the items to confirm against the image you choose, your hosting layout and your identity requirements before users depend on the system.
Redmine and Ruby versions in the image
Redmine 7.0 runs on Rails 8.1 and supports Ruby 3.2, 3.3, 3.4 and 4.0. Check which Redmine tag and Ruby version your chosen Docker image ships, and confirm that the tag is on a supported line. Redmine 6.0.x receives only important security updates, so an image pinned to an older line needs a dated upgrade plan.
- Fully supported line
- 7.0.x
Email, Sidekiq and preview tools in the image
Confirm whether the image includes the optional tools Redmine uses for thumbnails and previews, such as ImageMagick, Ghostscript and Pandoc, and whether it runs Sidekiq for background jobs. If they are missing, you will need a derived image or extra containers. Test outgoing email from inside the Redmine container, because notifications depend on it.
Single-host failure exposure
A one-host Compose stack places Redmine, PostgreSQL, the reverse proxy and the volumes on one machine. A disk failure, host outage or failed upgrade stops all of them together. Record the recovery time you need, confirm that backups are stored off the host, and test a restore on a separate machine before go-live.
PostgreSQL high availability needs external tools
PostgreSQL provides replication and hot standby servers, but it does not detect a failed primary or promote a standby on its own. A Compose file with one database container has no automatic failover. If uptime requirements call for it, plan the failover tooling, the fencing approach and the client reconnection path as a separate project.
PostgreSQL failover docsNo built-in SSO in core Redmine
Core Redmine authenticates against LDAP directories but does not provide SAML or OpenID Connect single sign-on. Sign-in through an identity provider depends on a plugin or an authenticating reverse proxy, and each choice affects the proxy configuration, session handling and the API. Confirm the method and the plugin's compatibility with your Redmine version before you build the Compose file around it.
Redmine home pageQuestions teams ask before running Redmine on Docker Compose
What does it cost to run a Redmine Compose stack?
Redmine itself has no license fee, since it is free under GPL v2, so the running cost comes from the hosting, the people who operate it and any plugins. PostgreSQL is also open source under a permissive license, so the database adds no license fee either. Recurring costs include the server or virtual machine, storage for the database and attachments, backup storage, SMTP relay and staff time for upgrades and security patches. One-time costs are the build, the initial hardening and the handover. Ask any quote to itemize hosting, build hours, plugin work and an upgrade allowance separately, so you can see which part recurs.
How long does a Compose build take, and what changes it?
The duration depends mostly on how much is decided before the build starts. A stack with one Redmine container, one PostgreSQL container, a reverse proxy, secrets and tested backups is a bounded job, while plugin selection, SSO, email relay setup and attachment sizing each add decisions and testing. Other drivers include whether the target host and DNS already exist, how quickly certificates are issued, how many plugins must be validated against the Redmine version you choose and how much restore testing you require. Ask for a written scope with named milestones before accepting any timeline.
What must our team provide before the build starts?
Most of the dependencies sit with your infrastructure and identity teams. Typically you provide:
- A Linux host or virtual machine with Docker and the Compose plugin, sized for your user count and storage plan
- DNS records for the Redmine hostname and a certificate source for HTTPS
- An SMTP relay inside your network or from your mail provider, with an allowed sender address
- A secrets store or approved method for database passwords and the Redmine secret key
- Named people for backups, restore tests and upgrades, including someone who approves changes
Confirm each item with the owning team early, because certificate and mail approvals often take longer than the build itself.
Can a small team run this stack without outside help?
Yes, a small team with Linux and Docker experience can run this stack, provided someone owns it after handover. The skills that matter most are reading Compose files, managing volumes, restoring a PostgreSQL dump, applying Redmine upgrade steps and reading container logs. The upgrade procedure in the Redmine guide requires backing up the database and uploaded files, copying configuration and plugins, running database migrations and restarting, so the team needs time for that work and a rollback plan. Check whether two or more people can cover this work, since a single operator leaves the stack exposed during absences.
When should we hire a partner instead of building it ourselves?
Hire a partner when the build depends on decisions your team has not made, such as SSO design, plugin selection, backup retention, or evidence for an assessment. DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks, and most engagements are fixed-scope with scope and timelines agreed in writing before work starts. A partner also helps when your team lacks capacity for a retainer covering upgrades and patching. An in-house build makes sense when you have the skills, time and a clear owner for ongoing operations.
Is Docker Compose suitable for production, or do we need Kubernetes?
Compose can run a production Redmine for a single organization when one host, clear backups and a documented upgrade path meet your needs. Its limits are mainly operational: a single host is a single point of failure, scaling across several app servers needs extra design, and you must build your own monitoring and recovery steps. Kubernetes adds orchestration, rolling updates and node-level resilience, but it also adds cluster operations that someone must own. Redmine supports PostgreSQL, and PostgreSQL high availability needs external failover tools, so a higher-availability design needs planning whichever runtime you choose. Decide based on your recovery time expectations and the skills you have, and confirm both before choosing a runtime.
Which database versions and backups should the Compose stack plan for?
Use a PostgreSQL major version that is still supported on the date you go live. According to the PostgreSQL versioning policy, version 14 is supported until November 12, 2026, while 15, 16, 17 and 18 are supported later, so pick a version with enough remaining support for your planning horizon. Back up the database with a consistent dump and keep uploaded files in a volume that is backed up at the same time. Test restores on a separate host, because a backup that has never been restored is unproven. The Redmine upgrade guide and the PostgreSQL upgrade documentation both describe the database and files as the items to back up before any change.
How DeployOpen works on this
DeployOpen plans, builds, documents and supports Redmine with Docker Compose and PostgreSQL inside your own infrastructure, so the stack runs where your security and operations teams can review it. Engagements start from a written scope that sets out the services, volumes, secrets, proxy and backup steps before any work begins.
How we scope
- Confirm the Redmine version line, Ruby and PostgreSQL versions, and whether your team can accept the 7.0.x line.
- Agree the hostname, TLS certificate source, reverse proxy choice and whether Redmine will sit at a sub-URI.
- Record which backup target, retention period and restore test your organization requires before go-live.
How we build
- Write the Compose file with separate Redmine and PostgreSQL services, named volumes for database and files, and healthchecks.
- Load database passwords and SECRET_KEY_BASE through Docker secrets or _FILE variables, kept out of the Compose file.
- Configure the reverse proxy for HTTPS, upload size limits and forwarded headers, then test login, attachments and email links.
How we hand over
- Deliver the Compose project, environment templates, proxy configuration and a runbook covering startup order and volume locations.
- Document the backup flow around the containers, including a database dump and a copy of the files volume, with a tested restore.
- Walk your operations team through upgrade steps, plugin migrations on start and the rollback path before handover.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover, scoped in writing.
- Apply Redmine and PostgreSQL minor updates and review release notes against installed plugins before each change.
- Re-run restore tests and healthcheck reviews on a schedule agreed in the retainer, with findings tracked to closure.

