Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to get gunbot running on your virtual server - this guide assumes that you know how to get inside the linux server through SSH and does NOT cover all security measures, every line starting as $ means its a command as normal user, # means its a command as root (admin) on the command prompt. This also assumes that you are login as root for the first time on your server, the guide is adapted to work perfectly on Ubuntu 17.04;
- You would have to login for the first time on your root account, we want to create a new user and add sudo permissions (add administrator permissions to it)
- # adduser gunbot
- # usermod -aG sudo gunbot
- If you get any error msgs, means you did something wrong, the user that will be created has name "gunbot" and will become the user that we want to use. It will also ask you a few questions, you can just press enter on them and leave them blank, it will also prompt for a password, remember this as we will use it again to log back in.
- $ ssh gunbot@IP where IP is your server IP, if you use putty its slightly different.
- when asked for the password use the password you created when adding the user.
- Now we need to upgrade the server and set up the firewall
- $ sudo ufw status
- this will tell you if the firewall is inactive
- $ sudo ufw allow 22
- this will allow the users to use port 22 for ssh
- $ sudo ufw enable
- this will activate the firewall
- $ sudo apt-get update
- this will update the repositories sources
- $ sudo apt-get upgrade
- this will upgrade the system
- $ sudo apt-get install nodejs npm nodejs-legacy
- installation of the service program that will run gunbot or gunbot gui in the background (sjakil)
- $ sudo npm install -g pm2
- installation of pm2 to manage the bot
- Now some of those commands will require y/n answer, please carefully select y or yes on the prompts by the console.
- Our server is almost ready, now we need to get gunbot going and unzip to unzip gunbot
- $ sudo apt-get install unzip
- then we need to download gunbot, you go to https://github.com/GuntharDeNiro/Gunthy/releases then you grab the link, in this case, https://github.com/GuntharDeNiro/Gunthy/releases/download/5055RC/Gunthy_v5055_RC_8ab53b2.zip and then you go into the console an input this using wget command
- $ wget "https://github.com/GuntharDeNiro/Gunthy/releases/download/5055RC/Gunthy_v5055_RC_8ab53b2.zip"
- this will download gunbot
- $ unzip *.zip
- this will unzip everything under the current directory, we only have Gunthy zip so it should only decompress that.
- $ ls
- this will show you the folders/files on the current directory where your shell is running, we now need to navigate to your gunbot folder, so we will do so using cd command
- $ cd foldername
- make sure to input folder name right, most of the time you can start writing the folder name and just press TAB on your keyboard to autocomplete it
- you now should be on the gunbot folder, we need to chmod gunthy executable by using
- $ chmod +x gunthy-linx64
- then now we are almost ready, we just need to modify our config.js which is our configuration file by using nano editor
- $ nano config.js
- make sure you are already on the folder that contains gunthy executable and config.js or you'll open a new file.
- then you can just proceed to edit, add your api keys and so on, after thats done then we need to run the bot on pm2
- we do so by using this command on the same directory as the executable
- $ pm2 start gunthy-linx64
- then you can see the process is running by using
- $ pm2 list
- this will also get you and ID which you can use monitor logs and stop/start the bot, most of the time it will be ID 0 if not was running so you can check it by using
- $ pm logs 0
- and you'll be looking at the logs, pressing CTR+C on your keyboard will close this screen in order to get back into the command prompt
- Thats it, now your bot is running on the pm2 instance, if you want to stop the bot
- $ pm2 stop 0
- it could be different than 0 if you have more than 1 program running on pm2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement