This guide is a continuation of How to deploy a Rails app using Digital Ocean and will walk through how to deploy Redis and Sidekiq on the same Digital Ocean Droplet as your Rails application.
$ ssh deploy@[ip_address]
$ sudo apt install redis-server
Redis should already be running on boot of the server.
$ systemctl status redis
You should see a response that looks similar to this. Look for the active (running) status:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-07-27 20:09:11 UTC; 1min 20s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 20499 (redis-server)
CGroup: /system.slice/redis-server.service
└─20499 /usr/bin/redis-server 127.0.0.1:6379
If you see an error where Redis canno be found Unit redis.service could not be found.
, symlink from Created symlink /etc/systemd/system/redis.service → /lib/systemd/system/redis-server.service.
using:
$ sudo systemctl enable redis-server
Reload the deamon and restart redis
$ systemctl daemon-reload
$ systemctl restart redis
The default redis configuration should work for most hobby applications. In case you need to modify the redis config, run:
$ sudo nano /etc/redis/redis.conf
Gemfile.rb
to development gem groupgroup :development do
gem 'capistrano-sidekiq'
end
Install the gem
$ bundle
Capfile
require 'capistrano/sidekiq'