Install Redis-Commander as service on Ubuntu 19.04

1.3k Views Asked by At

I created my self a virtual machine with an Ubuntu 19.04 guest system running redis and redis commander.

I can access the redis commander via 8081 but need to start it manually everytime I start the VM.

How would I install the redis-commander as linux service? I would like to keep it directly installed in Ubuntu and not running in a docker container.

1

There are 1 best solutions below

0
On

Yes, you can. I had the same issue but on Centos 7. In /etc/systemd/system directory you should create .service file, for example, my-redis-commader.service. The content of file is like this:

[Unit]
Description=Redis Commander Activator
After=network.target

[Service]
WorkingDirectory=/usr/lib/node_modules/redis-commander/bin/
ExecStart=/usr/bin/node /usr/lib/node_modules/redis-commander/bin/redis-commander.js

[Install]
WantedBy=multi-user.target

where

/usr/bin/node - node.js executable file

/usr/lib/node_modules/redis-commander/bin/redis-commander.js - is the file of node.js module, which run the web application - gui for redis server.

Then run:

systemctl enable my-redis-commander.service
systemctl start my-redis-commander.service

Check status:

systemctl status my-redis-commander.service