Skip to main content

Linux

Installing Gunbot on Linux

note

This guide is written specifically for the Ubuntu 22.04.1 server version, but most of the commands will likely work on other Linux distributions as well. If you're using the Ubuntu desktop, you can use the built-in terminal instead of connecting remotely to your server.

We've made this guide as simple as possible, including some extra steps that may not be necessary for experienced Linux users. There are several ways to install Gunbot on a Linux virtual private server, so feel free to explore other options.

Prerequisites

For Windows:

  • Download PuTTy from here
  • Download WinSCP from here

For MacOS:

  • Download Filezilla from here

Getting your first VPS

Popular VPS providers among Gunbot users are Hetzner Cloud, DigitalOcean, Vultr and Contabo. These links are referral links, so you'll get a small credit from these VPS providers to start off.

Sign up for any of these providers, order a Linux VPS server, and you'll receive an email with your server access credentials.

Connecting to your VPS

On Windows

Open PuTTy and enter your Server IP in the Host Name (or IP Address) field. Leave the port untouched. Then click "Open" at the bottom.

You may receive the following message when you first connect to your Server, which is normal. Simply press "Yes"

Then simply enter root for "login as" and then the password given to you by your VPS Server provider.

On MacOS

You can connect to your VPS by entering this command in your Terminal:

ssh root@YOUR.IP.ADDRESS.HERE

Replace YOUR.IP.ADDRESS.HERE by your actual Server IP Address.

Then press enter and it'll ask you for your server password. Note: while you type in the password, no characters are shown in the terminal. Just copy and paste the password given by your VPS Server provider into the terminal and press enter.

Configuring the VPS

First you'll have to run a couple of commands before your VPS is ready to use Gunbot.

Update your VPS

Run this command to update.

apt-get update && apt-get upgrade -y

Install NodeJS

NodeJS is a requirement for PM2 which we'll install in the next step. First we'll need curl (if it is not installed yet).

apt-get install curl

Then add Node to your sources.

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

Then install NodeJS and npm.

apt-get install nodejs
apt-get install npm

Install PM2

PM2 is a very powerful process manager which has many out of the box features like restart all processes on restart of the server and much more.

Install PM2.

npm i -g pm2

As PM2 creates it's own logs, we want to avoid the server from getting overflowed by logs. This package takes care of this.

pm2 install pm2-logrotate

Once everything is properly installed, you'll see the following:

Now you can proceed to the next step, however don't close your PuTTy (or Terminal) window yet.

Installing Gunbot

The latest release for Gunbot can always be found here Click on the gunthy_linux.zip to download and once the download has finished, extract the zip file on your computer.

Open WinSCP (or Filezilla) and enter your VPS server credentials again just as you did while connecting with PuTTy (or with the Terminal).

After connecting, you'll end up in the home folder of the user you're using for connecting (in this case root).

Click the 3 dots on top to move one folder up in the folder hierarchy and click on the folder called "home".

Then right-click and create a folder with the name Gunbot.

Double-click on the Gunbot folder to enter it and then drag and drop everything from inside of the Gunbot folder you've unzipped into it to upload Gunbot.

Once the uploading process has finished, head over to your PuTTy window (or Terminal) and type the following command:

cd /home/Gunbot

And then:

chmod +x gunthy-linux

Start Gunbot!

Once all the above steps have completed, you can start your Gunbot with the following command:

pm2 start gunthy-linux

You will see that Gunbot started with the PID (Process ID) 1.

In order to see the logs of your Gunbot, you can type this command:

pm2 logs 1

Now you can access the Gunbot GUI from your computer by typing http://localhost:5000 in your favorite browser (replace localhost by your ServerIP, for example http://123.456.789.0:5000).

Optional steps

Custom naming

You can give your Gunbot a different name with PM2 when starting it by issuing the command:

pm2 start gunthy-linux --name YourCustomNameHere

This is especially useful when you're running multiple Gunbot instances and wish to have an easier way to differ from them all from console.

Restart Gunbot on reboot automatically

To restart Gunbot on a server reboot automatically, issue this command:

pm2 startup

And then

pm2 save

In case your server restarts, Gunbot will be restarted automatically.

Complete this section