I started investigating Gunbot when their collaboration with Nash started. It’s a powerful tool which will turn you into an algo trader if you’re willing to dedicate some time to learn how it works.
At any step of the way, you can ask for help to your reseller and installation is fairly straightforward. The next step - and the one I would like to tackle in this post - is making your Gunbot autonomous so that you can turn off your computer while letting it run.
Rent a VPS and connect to it
You first need to rent a VPS. A VPS is a (Virtual Private) Server. For our needs, this should not cost more than $10 per month. As for recommendations, @canesin introduced us recently to Vishnu Korde, CEO of StackOS who could provide such a service (payable with NashLink and authentication using “Login with Nash” soon? ). I do recommend a Unix-based distribution (and will assume you made this choice too in the remainder of this tutorial). Most common one is
ubuntu (you can use latest version 20.04).
When this is done, you should receive credentials to connect to your server using SSH:
- IP address of your server
To connect to your server using SSH on Mac or Linux, open a terminal and run the following command:
ssh root@<ip-address-of-your-server> ( ctrl + D to disconnect)
(On Windows, you may use the console or better yet a simple program like PuTTY)
Prepare your server
Once you’re connected, you will see something like this:
It means you are connected as the user
root, which is more or less the admin of your VPS. It is generally good practice to create and use a user with limited privileges, but for simplicity you can use
root: it’s not really an issue.
Create a gunbot folder to isolate your work:
Then get into that new folder
You can check which files/folder are in there by running:
(obviously the command will return nothing, since we just created the folder)
N.B: Once Gunbot releases an official stable release which supports Nash, it will simplify the process, but for now this is it.
You will now need to get the Gunbot files on your server. This is a 4-step process (to do on your computer, not on the server):
1/ Download the latest stable build (18.8.8 as I write this) from Github: it is the file called lin.zip. Once downloaded, you will need to uncompress it (this should be a native option when you double click it).
2/ Get the @neon-exchange folder from build 20.0.4 (ask your reseller for this) and place the folder in the node_modules from the folder you extracted above
3/ Get the latest executable - currently 20.2.8 (ask your reseller). It should be called gunthy-linux. Replace the one you see at the root of your gunbot by this new one.
4/ Open a new terminal on your computer and navigate* until you are inside the folder downloaded on step 1 and run the following command:
scp -r * root@<ip-address-of-your-server>:/root/gunbot/
(you will need to input your server password. This should be fairly long depending on your connection speed, as you are sending every file onto your server)
Now back to your ssh terminal, check the files have arrived using
ls. It should show all the Gunbot files.
Make sure your gunthy-linux file is executable by running:
chmod +x gunthy-linux
That’s it, you are now ready. Launch Gunbot by running:
Check that logs are normal. Additionally, on your favorite browser on your computer, go to http:// to use Gunbot’s GUI.
Keep the Gunbot process running
At this point, if you close everything, your Gunbot will cease to run. We need to make sure it continues to run, even after you’ve closed the SSH connection.
To achieve this, you will need a program called
pm2. Download it (on your server) by running on your server:
apt-get install pm2
Stop the Gunbot process if it was still running. Then, from your Gunbot server, run:
pm2 start gunthy-linux
To check the logs:
pm2 logs (ctrl + C to exit)
To check running pm2 processes:
To stop the gunbot/pm2 process:
pm2 stop gunthy-linux
That’s it! Congratulations if you made it until this point. You now have an autonomous Gunbot running on your VPS. You can safely turn off your computer
Bonus: Navigating in a unix terminal
Check in what folder you are (
pwd stands for “print working directory”):
Go to a folder (
cd is for “change directory”):