Search code examples
ruby-on-railsdeploymentvpssidekiq

How to start Sidekiq worker on Ubuntu VPS (Digitalocean)


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


Solution

  • 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.