Running gekko in the background with PM2

I noticed that quite a lot of users run gekko in a screen process to keep it running while they are logged off. But there's a better way, use PM2!

The installation is quite simple:
npm install pm2 -g
Ubuntu/Debian users might want to run it with: sudo

Now that you have pm2 installed, there's just one more step to start gekko:

For CLI bots use:

pm2 start gekko.js -n "yourNameHere" -- -c my_config.js

To run the UI use:
pm2 start gekko.js -n "ui" -- --ui

Everything after the doubledash is passed as an argument to the gekko.js process. The parameter -n names your process. You have to give every instance a name, otherwise pm2 will refuse to start more than one instance of gekko.

To list all running processes use:
pm2 list

To stop a process use:
pm2 stop [id|name]
for instance:
pm2 stop 0
pm2 stop ui

Once a process is stopped you can remove it from the list using:

pm2 delete [id|name]

for instance:
pm2 delete 0
pm2 delete ui

PM2 stores the output of each process in your users homedir in ~/.pm2/logs. You can watch the logs with:
pm2 logs
pm2 logs [id|name]
to watch a specific process

I hope this helps anyone who's stuck in a hell of running a bunch of screen processes in parallel.

Tips are welcome:
ETH 0x40ddba96695bc040ccbe34b4cfa3a7ae8f225583

Messages In This Thread
Running gekko in the background with PM2 - by SirTificate - 02-13-2018, 04:30 PM

Forum Jump:

Users browsing this thread: