How to start Sidekiq worker on Ubuntu VPS (Digitalocean)

user1883793 picture user1883793 · May 1, 2013 · Viewed 13.2k times · Source

I already setup Redis, Sidekiq and Rails app, I can access it form //url/sidekiq, but how do I start the Sidekiq worker on a VPS? On my local I do:
bundle exec sidekiq -q carrierwave,5 default

What should I do on a VPS hosting?

Thanks

Answer

Fabrizio Regini picture Fabrizio Regini · May 2, 2013

Looks like this is a duplicate of this question: how to detach sidekiq process once started in terminal

You have to run the following command from your Rails root:

bundle exec sidekiq -d -L sidekiq.log -q mailers,5 -q default -e production

This will detach the process so you can quit the ssh session and the command will keep running in the background, logging the output to the sidekiq.log file.

Take care to choose the appropriate position for the log file, and don't forget to setup a logrotate rule for it.