Running Redmine on several app servers: secret key and sessions

Running Redmine on several app servers keeps users signed in only when every node shares one SECRET_KEY_BASE and the same shared state. This page covers what to fix, what to share and what to confirm before you add a second node.

On this page

Why Redmine sessions break across several app servers

If you run two or more Redmine app servers behind a load balancer, each node must be able to read the same session cookie. Redmine uses the Rails cookie store for sessions, which means the session data lives in a signed and encrypted cookie in the user's browser, not on the server. A node can only accept that cookie if it derives the same signing and encryption keys from SECRET_KEY_BASE. When each container or host generates its own random value at startup, a user who lands on a different node after a request is treated as logged out, and the symptom looks like random sign-outs rather than an obvious error.

The official Redmine Docker image documents this directly: a fixed SECRET_KEY_BASE helps load-balanced replicas keep sessions, and changing the value later invalidates every existing session. Teams usually need this setup once they run replicas for capacity or rolling restarts, and the same key must be set identically on every node and kept across upgrades and secret rotations. Confirm how your platform injects the value (environment variable, _FILE secret or orchestrator secret) and who owns its rotation, since a rotation is a planned sign-out event for all users.

A fixed key does not solve everything on its own. Sessions are only one shared state problem: attachments written to local disk on one node will not be visible on another, background jobs need one queue that all workers read, and a sticky-session setting at the load balancer can hide the cookie problem without fixing the key handling. Confirm with your team how uploads, Sidekiq and the load balancer will be configured together before you treat a replica set as ready for production.

Which shared settings each option affects

This table compares four settings that must be decided before Redmine runs on more than one app server, showing what each one fixes, what breaks when nodes disagree, and when it fits. Read it as a checklist: every row that is not shared across nodes will show up as a symptom for users or background jobs.

SettingWhat it fixesWhat breaks if mismatchedWhen it fits
Fixed SECRET_KEY_BASE on every nodeLets any replica verify the signed session cookies issued by another replica, so users stay logged in when the load balancer moves themEach node rejects cookies signed by the others, so users are logged out or bounced to the login page at randomAny deployment with two or more app servers using the cookie session store; this is the default recommendation
Per-node generated keysNothing shared; each node can start on its own without coordinating a secretSessions are not portable between nodes, so sticky sessions at the load balancer become the only way to keep users signed inNot recommended for load balancing; may suit a single node or a test setup that will not be scaled out
Shared attachment storageGives every node the same uploaded files, so an attachment saved through one node can be downloaded through anotherDownloads return missing-file errors on nodes that did not receive the upload, and previews and thumbnails fail unevenlyAny multi-node setup; confirm the path or network filesystem supports the locking and permissions Redmine needs under your platform
Single Sidekiq queue with one Redis backendPuts background work such as email delivery in one place that every node can enqueue to and workers can drainJobs enqueued on one node are invisible to workers pointed at another Redis, so emails or project deletions silently stallMulti-node setups where email and other background tasks must run reliably; confirm Redis is reachable from every node and worker
Identical Redmine version and plugin setKeeps code, database migrations and session handling consistent across nodes during and after upgradesNodes on different releases can read or write data in incompatible ways, and plugin mismatches cause errors on some requests onlyAlways; roll out upgrades to all nodes in one planned window and confirm this with your release process
Shared database connection settingsPoints every node at the same database so issues, users and sessions data agreeNodes see different data, and any node pointed at a stale replica or wrong schema shows inconsistent recordsAlways for multi-node setups; confirm the database host, credentials and schema are identical on each node

How load-balanced Redmine nodes share state

A request enters the load balancer, which forwards it to any of several Redmine app nodes. Every node is started with the same SECRET_KEY_BASE, so a session cookie written by one node is accepted by the others, because the session data lives in the cookie itself. All nodes read and write one shared database and one shared attachments path, and they hand background work such as email delivery to a single Sidekiq worker pool that takes jobs from a shared Redis queue. Check that the secret is identical on every node, that the attachments path is mounted the same way everywhere, and that only one Sidekiq queue serves the pool.

Redmine nodes share one secret, database, attachments path and Sidekiq queue.

Setting up a second Redmine node safely

This sequence brings a second Redmine app server into service so that a user signed in on one node stays signed in on the other. Each step fixes one piece of shared state: the secret, the database, the attachment files, and the background queue.

  1. Generate and store one secret key base

    The platform team generates a single SECRET_KEY_BASE value and stores it in the organization's secrets manager under a named entry, with access limited to the people and automation that deploy Redmine. Redmine uses the Rails cookie store for sessions, so every node must be able to verify cookies signed by the others. Done means the value is recorded in the vault with an owner, and the team has confirmed that no node is still using a value generated locally. Rotating this key later signs out every user, so record that consequence in the change runbook.

  2. Set the same secret on every node

    The deployment team injects the stored SECRET_KEY_BASE into the environment of each Redmine container or host service, using the same variable name on every node. For the official Docker image, the value is supplied through the environment configuration of each replica, and the team confirms the variable is present in the running process rather than only in a template file. Done means each node reports the same non-secret fingerprint or passes a sign-in test that depends on the key, so drift between nodes is caught before users see it.

  3. Point all nodes at one production database

    Each node is configured with the same database host, name, and credentials from the vault, so that users, roles, sessions-related records, and issues are read from one source of truth. Local SQLite files or a separate database per node would split the data and make Redmine unsuitable for multi-user production use. The team runs the migration status check from one node only, then confirms every other node connects to the same database and sees the same project list. Done means an issue created on one node appears when fetched through another node.

  4. Mount one shared attachments directory

    Redmine stores uploaded files on disk, so all nodes must read and write the same attachments storage path from one shared volume or network file system. The storage team confirms the mount point, ownership, and write permissions match what the Redmine user expects on each node. Ask the storage provider to confirm locking and latency behavior for concurrent writes, since this is an environment-specific detail. Done means a file uploaded through one node downloads correctly through another, and the path is identical in each node's configuration.

  5. Run one Sidekiq queue with one worker

    All app nodes point to the same Redis instance and the same Sidekiq queue, so background jobs such as email delivery are picked up once by a worker that the team can monitor. Background processing moves off the default async adapter as described in the Sidekiq setup guidance for Redmine. The team starts the worker as a supervised service, confirms it connects to the shared Redis, and checks that a test notification email is queued and sent. Done means the worker process is running, and the queue shows the test job completed.

  6. Configure load balancing only where needed

    Add cookie-aware or sticky routing on the load balancer only if a specific behavior requires it, such as a plugin that keeps per-process state in memory. With the shared secret, shared database, and shared attachments in place, ordinary round-robin balancing should already preserve sessions. The network team documents any routing rule they add, including the cookie name and the reason for it, so the choice can be reviewed later. Done means the balancer configuration and its stated purpose are recorded in the runbook.

  7. Verify sign-in across both nodes

    A tester signs in through the load balancer, notes which node served the login, and then opens several pages that the balancer sends to the other node, including an issue view and an attachment download. The test is repeated after a node restart and with a deliberately timed request to each node directly. Done means the session stays valid on every node, the attachment loads, and the Sidekiq job created by a test action completes. Record the results and the node names in the change ticket before the second node receives production traffic.

Protecting the shared secret, uploads and sessions

Every app server in a Redmine pool has to trust the same secret, read the same files and follow the same session rules. When one of those three drifts, users get logged out, uploads disappear or an attacker gains a path around the others. The cards below cover the checks to make before the second node goes live.

Keeping SECRET_KEY_BASE out of images

The shared value signs and verifies session cookies, so anyone who holds it can forge a session for any user. Do not bake it into a Docker image, commit it to a repository or echo it in deployment logs. Inject it at runtime from your secrets store and confirm that container inspection and CI output do not reveal it.

Docker image notes

Planning rotation before it logs everyone out

Changing the value invalidates every existing session, so a rotation is a planned user event, not a routine config edit. Schedule it in a maintenance window, roll the new value to all nodes in one change, and tell users that they will need to sign in again. Record who approved the rotation and when it happened.

Limiting access to shared attachment storage

Every node reads attachments from the same storage path, so the storage is part of the trust boundary. Restrict the mount to the Redmine service accounts, avoid world-readable directories and confirm that no other workload can write into the path. Review who can reach the storage host through backups and snapshots as well.

Watching file permission drift between nodes

A node that runs under a different user ID or umask can create attachments that other nodes cannot read or overwrite. Those failures show up as broken downloads on only some requests, which makes them hard to trace. Match the user ID, group and umask on every node, and test an upload on one node followed by a download on another.

Aligning session lifetime with password and sudo policy

Session lifetime, password change rules and sudo mode interact. A long-lived cookie can keep a session alive after a password reset or an administrator's privilege change, unless those events are enforced on every node. Decide the session timeout with your security team, then test that a password change ends existing sessions on all nodes.

Redmine settings

Patching every node in the same window

Security releases change code that every node runs, and mixed versions can disagree about session format, migrations or plugin behavior. Patch the pool in one controlled window, keep the old image or package available for rollback, and run the database migrations once before traffic returns to the upgraded nodes. Confirm the version on each node afterward.

Operating a multi-node Redmine after go-live

Upgrades are where a multi-node Redmine is most likely to break, because every node must run the same code against the same schema at the same time. The Redmine upgrade guide sequence is to back up the database and uploaded files, copy configuration, uploads and third-party plugins to the new installation, run db:migrate and redmine:plugins:migrate, clear the cache, and then restart. On several app servers, the backup and migration steps run once against shared infrastructure, while the copy and restart steps must be repeated on every node that serves traffic. Decide before the first upgrade which node runs the migrations, how the rest are held out of rotation during the schema change, and who confirms that every node reports the same Redmine version before traffic returns.

A rolling restart is only safe when old and new application code can both read the schema for the duration of the roll. Plan this explicitly for each upgrade: check the release notes for migrations that drop or rename columns, confirm whether the plugins you run have been updated for the target Redmine version, and decide whether a short maintenance window with all nodes stopped is acceptable. Plugins deserve the most scrutiny, because a plugin that loads on one node and fails on another produces errors that look like random session or page failures. Ask your plugin vendor or maintainer to confirm compatibility in writing, and test the sequence on a copy of the production database and files first.

Rotating SECRET_KEY_BASE is a planned event, not a routine task. Because sessions are stored in the Rails cookie store, changing the key invalidates every existing session, so all users are signed out at once across every node. Schedule the rotation outside working hours, announce it to users, and rotate the value on every node in the same change window so that no node keeps accepting sessions signed with the old key. Store the new value in your secrets manager, record the rotation date in your change log, and confirm with the Docker or host configuration owner that no node was missed. Confirm also whether any API clients or scripts depend on an active browser session, since those will need re-authentication too.

Limits to confirm in your environment

A multi-server Redmine setup depends on a few behaviors that vary by release, storage layer, network path and installed plugins. The cards below list what to test in your own environment before you send live traffic through a load balancer.

Redmine and Rails version behavior

Confirm which release line you run before you copy any session or secret handling steps. 7.0.x is the fully supported line and runs on Rails 8.1, while 6.1.x and 6.0.x receive narrower fixes and 5.1.x and older are unsupported. Check the Ruby version against the installation guide, and test session behavior on the exact tag you deploy, not on a version someone remembers from an earlier install.

Redmine download page

Consistent file locking on shared storage

Every app server writes attachments to the same path, so the storage option you choose must handle concurrent writes and locks predictably. Ask your storage vendor whether an NFS, SMB or clustered file system provides consistent locking under concurrent uploads, and test two servers writing and reading the same attachment at the same time. Do not assume that a mounted volume behaves like a local disk.

Redis availability for background jobs

A shared Sidekiq queue needs a Redis instance that every worker and web process can reach, and that survives a node restart without losing queued work. Confirm where Redis runs, who patches it, how failover works, and whether your network policy allows traffic from every app container or host. Without a reachable Redis, email and other background jobs can stop while the web tier still appears healthy.

Load balancer session affinity

Because sessions live in the signed cookie, sticky sessions are not required when every node shares the same SECRET_KEY_BASE. Still, confirm the behavior with your load balancer, since an affinity setting can hide a mismatched secret until the pool is rebalanced. Test a login on one node, then force requests to other nodes and confirm the user stays signed in.

Plugin state outside the database

Some plugins cache data in memory, write local files, or keep tokens on disk, and those choices break when a second app server takes the request. Review each installed plugin's documentation and source for process-local state, and ask its author or maintainer whether it supports multi-process deployments. Plugins that fail this check should be replaced, configured to use shared storage, or tested on a staging pool before rollout.

Questions teams ask before running Redmine on several servers

Do we need a fixed SECRET_KEY_BASE when Redmine runs on several app servers?

Yes, every app server must share the same SECRET_KEY_BASE or users will be logged out when a request lands on a different instance. Redmine stores sessions in the Rails cookie store, so each server has to read and verify the same signed session cookie. The official Docker image notes that changing this value invalidates existing sessions and that a fixed value helps load-balanced replicas keep sessions. Generate the value once, store it in your secrets manager, and inject it into every replica. Rotating it later signs everyone out, so plan that change as a scheduled event.

What drives the effort of a multi-server Redmine setup?

Effort depends mainly on how many app servers you run, where they sit, and how many shared components you must build around them. The main drivers are the load balancer and its TLS termination, the shared attachment storage that every replica must reach, the database and its connection limits, and whether background jobs run in one Sidekiq queue that all replicas feed. Plugin compatibility and the number of environments to keep in step, such as staging and production, also add work. Ask any partner to show the written scope for each of these items before agreeing a quote.

Why does shared attachment storage matter for load-balanced Redmine?

Attachments written by one app server must be readable by every other server, or users will see missing files after a request is routed elsewhere. Redmine stores uploads under a configured attachments path, so the replicas need the same storage mounted at that path, such as a network file system or an object-backed mount that your platform supports. Confirm the exact storage model with your storage vendor and test uploads, downloads and thumbnails from each replica. Backups must cover this storage as well as the database.

Can our own team run a multi-server Redmine deployment without a partner?

Your team can do it if it already runs Rails applications behind a load balancer and has experience with shared storage, secrets management and database connection tuning. The hard parts are rarely the Redmine settings themselves. They are session behavior during failover, consistent secrets across replicas, and proving that uploads and background jobs behave the same on every node. Write down who owns each component, test a rolling restart and a node failure before go-live, and decide who will apply the security releases listed on the Redmine download page.

What happens to background jobs when Redmine runs on several servers?

Background work such as email delivery and project deletion should run in one shared queue, not in each app server's own memory. If every replica uses the default async adapter, jobs can run on a server that is later stopped, and they cannot be retried from another node. A single Sidekiq queue backed by Redis gives every replica the same job list, with workers running on a host or container you control. Confirm the Redis setup, the worker count and the restart behavior with your team before launch.

How long does validation take, and what should we test?

Validation time depends on the size of the deployment, the number of environments and how many integrations and plugins you run, so ask for a timeline in the written scope rather than relying on a general figure. Test login from several nodes, session survival during a rolling restart, upload and download from every replica, email notifications, scheduled jobs and a node failure. Repeat the checks after each Redmine patch, because upgrades and plugin migrations can change behavior across instances.

What must our team provide before a multi-server Redmine project starts?

Your team needs to supply the target infrastructure, the load balancer or ingress design, the production database and its access rules, shared storage for attachments, a secrets store for SECRET_KEY_BASE and database credentials, and a mail relay. You also need a named owner for DNS, TLS certificates and change approval, plus the list of plugins and their versions. Agree these inputs in writing at the start, because missing access to any of them is a common cause of delay and extra scope.

Does a multi-server setup change how we patch and upgrade Redmine?

Yes, because every replica must move to the same Redmine version and receive the same plugin migrations in a controlled order. The upgrade guide calls for backing up the database and uploaded files, copying configuration, uploads and third-party plugins, then running the database and plugin migrations before clearing the cache and restarting. Plan a rolling upgrade that keeps at least one node serving, and confirm that all replicas use the same SECRET_KEY_BASE before and after the change. Check the supported release line on the download page before scheduling the work.

How DeployOpen scopes multi-node Redmine deployments

DeployOpen plans and builds multi-node Redmine deployments inside your own infrastructure, starting with how each app server will share one SECRET_KEY_BASE, session handling, attachment storage and background job queue. The written scope, build notes and handover documents show your team exactly how the nodes stay in step.

How we scope

  • Map every app server, load balancer path and container replica that will serve Redmine requests and sessions.
  • Confirm where SECRET_KEY_BASE will be stored and who may rotate it, with the effect on active sessions written down.
  • Agree in writing which shared attachment storage, database and single Sidekiq queue each node will use, plus the rollout order.

How we build

  • Set one fixed secret on every node and verify that a login made on one replica is accepted by the others.
  • Configure the Rails cookie session store consistently and test session behavior through the load balancer under failover.
  • Mount shared attachment storage on all nodes, confirm the Sidekiq worker reads the same queue, and test uploads and background email delivery.

How we hand over

  • Deliver configuration records showing where the secret lives, how each node reads it, and which settings must match across nodes.
  • Document the procedure for planned secret rotation, including the expected logout of active users and the communication needed.
  • Provide test scripts and a runbook for adding a new app server without breaking existing sessions or shared storage paths.

How we support

  • Fixed-scope engagements end with the agreed handover, and ongoing support, upgrades and continuous testing are available as a retainer.
  • Retainer work can cover Redmine upgrades, re-verifying session behavior after infrastructure changes, and reviewing new app server additions.
  • Ask for the support boundaries, response expectations and change-control steps in the written quote before work starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.