Setting up Sidekiq background jobs for Redmine

Set up Sidekiq and Redis so Redmine's background jobs, such as email delivery and project deletion, run in a supervised worker instead of the default async adapter.

On this page

Why Redmine teams set up Sidekiq background jobs

A production Redmine that still runs background work in the default async adapter has no supervised worker process to hold that work. Sidekiq, backed by Redis, gives Redmine a persistent job queue with a separate worker process that you can start, monitor and restart like any other service. The change is worth making once background jobs matter to your users or your operations: when email delivery, deletions and other queued tasks must survive a web process restart, when you need to see failed jobs, or when one application server is no longer enough to absorb the work.

The reason the question has become more pressing is how much work Redmine now moves off the request cycle. Redmine 5.1.0 moved project deletion to a background job, so deleting a large project no longer depends on a single web request finishing. Redmine 4.0 removed the older asynchronous email delivery methods in favour of Rails Active Job, which means the queue backend you choose decides how outgoing notifications are processed. Before you change anything, check which of these paths your instance uses and confirm how your current adapter behaves when the application restarts during a busy period.

The installation guide lists Sidekiq as an optional component for background job queues in production, so it is a supported choice rather than an extra you must add. Treat it as part of the production design: plan the Redis instance, the worker service, its logging and its restart behavior together with the web tier. If your team cannot yet say who restarts the worker after a failed deploy or how queued jobs are counted during an upgrade, resolve those questions before you switch adapters, because a worker that silently stops is harder to notice than a web page that fails.

How a Redmine job reaches the Sidekiq worker

The trip starts in the Redmine web process, which places a job on a queue held in Redis instead of running slow work inline. The Sidekiq worker, running as its own process, pulls that job from Redis and performs it, such as sending an email through the SMTP relay or writing results to the database. The trust boundary sits around Redis: only the application network and the worker should reach it, so check that Redis is not exposed beyond those hosts and that the worker can reach both Redis and the database.

Redmine enqueues work in Redis, and the Sidekiq worker performs it against the database or SMTP relay.

Which Redis and worker options fit your environment

This table compares a single Redis instance, Sentinel-managed Redis or Sentinel-managed Valkey, and running the Sidekiq worker on the Redmine host or on a separate host. Read each row against your own failover target, licensing review and the staff who will watch the queue. The main takeaway is that a single Redis instance and a same-host worker are the simplest starting point, while Sentinel and a separate worker add failover and operational effort.

OptionWhat it meansWhen to choose it
Single Redis instanceOne Redis server holds the Sidekiq queue. If it stops, queued email and project deletion jobs wait until it returns. No automatic failover.Small installations where a short queue outage is acceptable and the team wants the fewest moving parts.
Sentinel-managed RedisSentinel monitors the Redis master and promotes a replica on failure. The Sentinel docs say a robust deployment needs at least three Sentinel instances.Installations that need queue failover and can run three Sentinel processes and at least one replica.
Sentinel-managed ValkeyValkey Sentinel provides the same failover model. Valkey is a BSD-3-Clause fork of open-source Redis, and existing Redis client libraries connect without code changes, per the Valkey migration guide.Teams that want an open-source license without Redis's source-available terms for the Redis 7.4 to 8.x lines.
Redis license choiceRedis 8.0 and later are offered under RSALv2, SSPLv1 or AGPLv3 at the user's choice. Redis 7.4 to 7.8 use RSALv2 or SSPLv1, which are not OSI-approved. Confirm the license selected with your legal team before you pin a version.Organizations that must document an OSI-approved license for every component of the Redmine stack.
Worker on the Redmine hostSidekiq runs beside Puma or the Redmine container, sharing its configuration, secrets and code version. Fewer hosts to patch and monitor.Single-server or small deployments where one upgrade window covers the web app and the worker.
Worker on a separate hostSidekiq runs on its own host with the same Redmine code, configuration and secrets. Jobs keep running when the web process restarts, but both hosts must be upgraded together.Larger installations where email or deletion jobs need their own capacity, or where the team wants to restart web and worker independently.
Ongoing operational effortSentinel adds processes to watch, failover tests to schedule and Redis upgrades to track. A separate worker adds a host, a service unit and a version check after every Redmine upgrade.Confirm with your operations team who will monitor the queue and run failover drills before choosing the more complex option.

Choosing a Redis version and license without surprises

The license attached to a Redis version matters before the first install, because the Sidekiq queue will sit in your stack for years. Redis 8.0 and later can be used under a license of your choice among the Redis Source Available License v2 (RSALv2), the Server Side Public License v1 (SSPLv1) and the GNU AGPLv3. Redis 7.4.x through 7.8.x remain under the dual RSALv2 or SSPLv1 license, neither of which is OSI-approved. Redis 7.2.x and earlier remain under BSD-3-Clause. Before choosing a version, check the Redis licenses page and note which line you are pinning in your deployment, whether that is a container tag, a package repository or a build from source.

Redmine itself does not depend on a particular Redis license. The license question applies to the Redis server that Sidekiq connects to, and it should be decided by your organization, not by the installer. Ask your legal team which license terms fit your use, including whether you modify Redis or offer it as a network service, since the Redis licenses FAQ describes different obligations in those cases. Teams that run unmodified Redis artifacts from 7.2 or earlier are described as seeing no impact when moving within that line, but that statement still needs a check against your own situation. This guide does not provide legal advice.

If the license terms are a problem, Valkey is an alternative to evaluate. Valkey is licensed under BSD-3-Clause, was forked from open-source Redis before the move to source-available licenses, and is maintained as a community project under LF Projects, LLC. Valkey 9.1 is the current stable line, and Valkey's migration guide says existing Redis client libraries connect without code changes, which Sidekiq's Redis client will need for a drop-in test. Confirm with your legal team and with Sidekiq's supported-server guidance that the chosen server and version work for your setup, and record the decision and the pinned version alongside your Redmine change records.

How to install Redis and wire Sidekiq into Redmine

This sequence takes a Redmine server from the default async adapter to a Redis-backed Sidekiq queue, with each step ending in a check that proves the component works before the next one depends on it. The result is a supervised worker that picks up Redmine's background jobs and delivers a test email.

  1. Install Redis Open Source on a supported host

    The Linux administrator installs Redis Open Source from the distribution packages or the vendor's build instructions, using a version that the Redis install page lists for Linux. Confirm the exact version you install against the Redis licenses page, because the license terms changed across the 7.x and 8.x lines and your legal team may need to approve the chosen version. Enable the service so it starts at boot. Done when redis-server --version prints the installed version and systemctl status redis shows the service active.

  2. Bind Redis to a private interface and test it

    Edit the Redis configuration file so the bind directive lists only the loopback address or the private interface that the Redmine application servers use, and keep protected mode enabled. Set a password with requirepass or the ACL settings your team has standardized on, then restart the service. Done when redis-cli -h <private-ip> -a <password> ping returns PONG from the Redmine host, and the same command from an address outside the private network fails.

  3. Add the sidekiq gem to Gemfile.local

    On the Redmine host, the administrator adds the sidekiq gem and the Redis client to Gemfile.local in the Redmine root, then runs bundle install under the same Ruby version Redmine uses. Pick the gem version that matches your Redmine release and Ruby version, and confirm it against the Redmine email configuration wiki before you pin it, because the supported combinations change between Redmine lines. Done when bundle exec sidekiq --version runs from the Redmine directory without a load error.

  4. Point Active Job at Sidekiq with the Redis URL

    Add the Active Job adapter setting for Sidekiq in the Redmine configuration and supply the Redis connection URL through an environment variable or a protected file, not in a file tracked by version control. Confirm the configuration key names and the placement for your Redmine version in the Redmine email configuration wiki, since the method for choosing the queue adapter is documented there. Restart Redmine so the new adapter loads. Done when the Redmine application boots without errors in its log and the Sidekiq adapter is reported as active from a Rails console.

  5. Run the Sidekiq process under a supervisor

    The administrator creates a systemd unit (or the equivalent service manager on your platform) that runs the Sidekiq process from the Redmine directory as the same service account that runs Redmine, with the same environment variables. Set the unit to restart on failure and to start after Redis and the database are available. Enable and start the unit, then check the process log. Done when systemctl status shows the worker active and the Sidekiq log reports that it has connected to Redis and is processing the default queue.

  6. Send a test email and confirm the job runs

    From the Redmine administration area, the administrator sends a test email, or triggers an action that queues a notification such as a new issue assignment. Watch the Sidekiq log and the Redis queue length while the job runs, then confirm the message reaches the mailbox. Done when the job appears in the Sidekiq log as completed, the queue drains back to zero, and the email arrives. If the job fails, check the Redis connection string, the worker's environment and the mail relay settings before changing the Redmine configuration again.

Keeping the Sidekiq worker running after restarts

A Sidekiq worker that stops quietly leaves email and project deletion waiting in Redis with no visible error in the web interface. The cards below cover the supervisor, logs, queue visibility, Redis storage and failover, and the checks to repeat after each Redmine upgrade or plugin change.

Restart policy for the worker

Run Sidekiq under systemd or your container orchestrator with a restart policy so a crash or host reboot brings the worker back without manual action. Make sure the unit starts after Redis and the database are reachable, and that it runs as the same user and from the same Redmine directory as the web server. Test by killing the process and rebooting a staging host. A worker that restarts but cannot reach Redis will fail again, so confirm the restart produces a live process that picks up a test job.

Email configuration

Log location and rotation

Decide where Sidekiq writes its log, usually a file under Redmine's log directory or the journal when run by systemd, and set rotation so the file cannot fill the disk. Failed jobs and exceptions appear here first, so a log nobody reads is a delivery problem nobody sees. Confirm the path, the retention period your operations team requires, and who receives alerts for errors. Check the log after each restart to confirm the worker reports a clean start.

Queue monitoring and alerting

Watch the size and age of the queues that carry Redmine mail and project deletion jobs. A growing backlog usually means the worker is stopped, blocked, or unable to send mail through the SMTP relay. Sidekiq's web dashboard can be exposed behind authentication for this purpose, but it should not be public. Agree on an alert condition with the team that owns the mail relay, and document who responds at night.

Redis memory and persistence settings

Set a memory limit and eviction behavior in Redis that will not silently drop Sidekiq jobs. Choose a persistence mode, such as AOF or RDB snapshots, that matches how much queued work you can afford to lose on a crash. Confirm the Redis version you run against the Redis licenses page before you upgrade, since the license terms changed with Redis 8. Test a restart with queued jobs present to see what survives.

License change line
Redis 8.0
Redis licenses

Failover through Sentinel

If Redis is a single point of failure for background work, a Sentinel setup can promote a replica when the primary fails. Sentinel only applies when you are not using Redis Cluster, and the Redis documentation says a robust deployment needs at least three Sentinel instances. Confirm that Sidekiq is configured to discover the current primary through Sentinel rather than a fixed address, and test a failover before relying on it. Ask your Redis provider whether the Sentinel setup is supported for your version.

Minimum recommended
3 Sentinels
Sentinel docs

Checks after upgrades and plugin changes

Redmine upgrades and plugin migrations can change job classes, and a worker still running old code may fail on jobs queued by the new web process. After running the upgrade steps, restart Sidekiq together with the web server, then confirm that a test email is delivered and that a test project deletion completes. Check the log for errors from plugins that were not updated. Record these checks in the upgrade runbook so they run every time.

Upgrade guide

Questions teams ask before setting up Sidekiq for Redmine

What does a Sidekiq setup for Redmine cost, and what drives the price?

The software is free, so the cost is labor, Redis hosting and the verification work around it. Redmine has no paid edition under GPL v2, so the spend comes from the people who configure and maintain the stack. The main cost drivers are the number of environments (production, staging, and any test copies each need a worker and a queue), whether Redis is self-hosted or managed, how many high-availability components you require, and the plugin inventory, since plugins that send email or run custom jobs need testing against the worker. Ask any partner for a written scope that lists each environment, the Redis topology, and the plugins covered. Ask which costs are one-time (initial build and testing) and which recur (Redis hosting, patching, worker monitoring). DeployOpen provides a quote from the written scope.

How long does it take to move Redmine background jobs to Sidekiq?

The duration depends on how many environments you run, how Redis is deployed, and how many plugins touch background work. A single production instance with one Redis server is the simplest case. Adding staging, a Redis high-availability layer, or plugins with their own jobs adds testing time. DeployOpen does not publish durations, so the timeline is set out in the written scope before work starts. Ask for the milestones: Redis installed and reachable, worker running as a service, a test email and a test project deletion processed by the worker, and a restart test that confirms the worker recovers.

What does our internal team need to provide for a Sidekiq setup?

Your team needs to supply access and decisions, not necessarily Ruby expertise. Expect to provide a host or container platform where Redis and the worker can run, network rules allowing Redmine to reach Redis, the Redmine version and deployment method in use, the list of installed plugins, and the email relay settings. Someone must also own the decision on where Redis runs and who is paged when the worker stops. If you run Redmine in an offline network, confirm early how Redis packages and gems will be delivered, because that changes the build sequence.

Can our own team set up Sidekiq for Redmine without a partner?

Yes, a team with Linux and Rails operations experience can do it, and the documentation is public. The work involves installing Redis, adding the Sidekiq gem and a queue adapter configuration to Redmine, running the worker under a process supervisor, and testing the jobs. The risk is less in the first install than in maintenance: Redis versions and licenses change, and the worker must be watched after upgrades. Check your team's capacity to patch Redis and Redmine on a schedule, and to test that background jobs still run after each Redmine or plugin upgrade. A partner is useful when you need the work documented, tested and handed over in a fixed scope.

How does Sidekiq differ from the async adapter in Redmine?

The async adapter runs jobs inside the Redmine process, while Sidekiq runs them in a separate worker that reads from a Redis queue. Redmine 4.0 removed asynchronous email delivery methods in favor of Rails Active Job, so background delivery now depends on the queue adapter you configure. With Sidekiq, jobs survive a web process restart, can be retried, and can be scaled separately from the web tier. The trade-off is one more service to run: Redis, the worker, and their monitoring. Redmine 5.1.0 moved project deletion to a background job, so a project deletion on a large project can be handed to the worker instead of blocking a web request.

Which Redis license and version should we plan around?

Plan around a Redis version and license your legal team has approved in writing. Redis 7.2.x and earlier remain under BSD-3-Clause, while Redis 7.4.x to 7.8.x are under the dual RSALv2 or SSPLv1 license, which neither the OSI approves. Redis 8.0 and later can be used under a license of your choice among RSALv2, SSPLv1 and AGPLv3. The Redis licenses FAQ says teams moving from Redis 7.2 or earlier with unmodified artifacts see no impact, while modified code offered as a network service carries source-availability duties. Valkey is an alternative under BSD-3-Clause, and its migration guide covers moving from Redis OSS 7.2 and earlier. Confirm the choice with your legal and compliance owners before the build.

Does a Sidekiq setup need Redis high availability, and what does it add?

Not for every deployment, but you should decide deliberately. A single Redis server is the simplest option and is a single point of failure for queued jobs. Redis Sentinel, which is supported when you are not using Redis Cluster, provides automatic failover that promotes a replica to master. The Redis Sentinel documentation says a robust deployment needs at least three Sentinel instances. Sentinel adds servers, monitoring and failover testing to the cost. Ask for a written decision on whether Redis is single-node or highly available, and what happens to queued jobs during failover.

How DeployOpen scopes and delivers this Sidekiq setup

DeployOpen plans, implements, hardens and documents self-hosted Redmine inside your own infrastructure, and the Sidekiq setup is scoped the same way. Most engagements are fixed-scope, which means the scope, deliverables and timelines are agreed in writing before any work starts. For this topic, that written scope should name the Redmine version and deployment method, the Redis hosting model, the worker host or container, and the list of background jobs that must run through Sidekiq. Ongoing support, upgrades and continuous checks are available as a retainer if your team wants DeployOpen to keep the worker healthy after handover.

The work begins with an inventory. DeployOpen reviews which Redmine jobs your installation actually triggers, including email delivery and project deletion, and records the environments involved: development, staging and production, plus any air-gapped network where Redis and the worker must run without internet access. The inventory also confirms the Redmine and Ruby versions in use, since the Sidekiq integration must match the release line you run. From that inventory, the team agrees on the Redis deployment, the Sidekiq process manager and the log and restart behavior, and documents each decision so an auditor or new administrator can trace it.

Next, the worker is built and tested against the agreed scope. Tests cover job enqueueing, a worker restart with queued jobs present, a Redis outage and a failed email relay, and they confirm that the worker runs as a supervised service under your existing process controls. The engagement ends with a handover runbook covering start, stop and restart steps, queue inspection, Redis credentials and backup, upgrade steps and the checks your team should run after each Redmine or Redis update. Your team receives the configuration, the test results and the runbook, and the setup is ready to operate without DeployOpen on call.

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.