My development environment is a dedicated Ubuntu server (my project involves two web apps interacting with each other, too heavy and too complicated to set up locally). On this server, I would like to run sidekiq and discourse at startup. I played with rc.local, but couldn’t figure it out. Anyone succeeded with this?
AI-generated summary
In this Dev category discussion titled ‘Development environment: running sidekiq and discourse at startup’, jack2 seeks to auto-start Sidekiq and Discourse on a dedicated Ubuntu server for plugin development, having struggled with rc.local. mpalmer questions why Docker isn’t used, but jack2 explains it’s for plugin dev. Falco suggests using systemd or adding Sidekiq to the auto-start script, noting it’s unusual for dev, but jack2 cites Discourse’s recommendation to run Sidekiq even in dev mode. cpradio recommends using the vagrant.screen script, adapted for non-Vagrant setups. jack2 reports confusion over Sidekiq’s status but decides to proceed without it. Mittineague clarifies Sidekiq isn’t optional for many background jobs and suggests manually starting it in a separate terminal. cpradio explains how to verify Sidekiq is running in screen using CTRL+a, ". jack2 confirms the issue was a mistaken -d flag and that the warning message disappeared. drew0101 reports similar Docker-related issues with Sidekiq jobs stuck in ‘Enqueued’ and admin dashboard claiming it’s not running. jack2 shares that the warning is normal in dev and suggests setting config.eager_load = true in development.rb — which drew0101 confirms fixes the issue. Finally, jack2 asks if Sidekiq now auto-starts, and sam clarifies that bin/unicorn starts Sidekiq by default, unless -x is used to disable it.
Why can’t you run Discourse in a docker container, as recommended?
Because I develop plugins.
Sidekiq creator just tweeted about this:
https://twitter.com/mperham/status/837024296044130304
If Discourse is auto starting in this setup you created, just add a new line there to start sidekiq. If you are on latest Ubuntu that would be a systemd service file.
Not sure why you need an auto starting Sidekiq in a dev instance tough. That’s where I enjoy having a tighter control about stuff like sidekiq.
There is a screen script that you can run that will start all necessary components
https://github.com/discourse/discourse/blob/master/docs/vagrant.screen
It is setup for the vagrant image but should be easy to amend.
Make a copy of it and change the cd /vagrant to your discourse directory
Amazing, thanks @cpradio!
Notice that I was not able to start sidekiq this way. Or was I? The various sidekiq-related messages are confusing, to say the least, but as sidekiq seems to be optional, I will forget about it for now.
Well, it is and it isn’t, depending on what you’re testing. Sidekiq handles a lot of “jobs” like updating the Users page, etc.
On my localhost when I want sidekiq to be running I usually just open another terminal and start it in that.
To find out, you simply need to press CTRL + a, ", it will show you a list, move up to the sidekiq one and press enter.
Here is a screenshot of the list
Here is the sidekiq window
There are a lot of good references out there for using screen, quick_reference [GNU screen] and linux screen keyboard shortcuts, for example.
Thanks @cpradio. I had mistakenly added a -d option, that’s why I had no output in the window. I also had this Discourse message saying that Sidekiq was not running (I have no explanation for this). But the message is gone now and everything looks fine. Thanks again.
I am having similar problems running sidekiq in a docker development environment. I have explored other topics with no success. I know sidekiq is running because going to localhost:3000/sidekiq shows me the sidekiq dashboard. I also see that every job stays in the Enqueued section. I have three terminal windows in my development environemt.
- Rails server that I started with d/rails s
- Mailcatcher that I started with d/mailcatcher
- Sidekiq that I started with d/sidekiq
I just cant for the life of me figure out why the admin dashboard says that sidekiq is not running, and why jobs stay in the enqueued section
I always have this warning message and Sidekiq works like a charm. So I came to the conclusion it’s the standard behavior for a dev instance.
This workaround worked for me: change config.eager_load to true in development.rb. See this thread:
Thank you! That fixed it
It seems Sidekiq is now launched automatically when the dev instance starts. Am I right? Still any need to launch it manually?
If you run bin/unicorn it automatically runs sidekiq if you don’t want sidekiq run bin/unicorn -x

