NadekoBot/docs/guides/Linux Guide.md

208 lines
8.0 KiB
Markdown
Raw Normal View History

2016-08-03 22:42:31 +00:00
#Setting up NadekoBot on Linux
####Setting up NadekoBot on Linux Digital Ocean Droplet
######If you want Nadeko to play music for you 24/7 without having to hosting it on your PC and want to keep it cheap, reliable and convenient as possible, you can try Nadeko on Linux Digital Ocean Droplet using the link [DigitalOcean][DigitalOcean] (and using this link will be supporting Nadeko and will give you **$10 credit**)
2016-08-05 17:35:47 +00:00
######Keep this helpful video handy [Linux Setup Video][Linux Setup Video] (thanks to klincheR) it contains how to set up the Digital Ocean droplet aswell and follow this [Guide](DigitalOcean Guide.md)
2016-08-03 22:42:31 +00:00
2016-08-05 16:55:08 +00:00
####Setting up NadekoBot
2016-08-03 22:42:31 +00:00
2016-08-05 17:35:47 +00:00
Note: When you install mono, please run update once more to check for any missing repos and dependencies.
2016-08-03 22:42:31 +00:00
2016-08-05 16:55:08 +00:00
####Installing Mono
2016-08-03 22:42:31 +00:00
######MONO (Source: [Mono Source][Mono Source])
`sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF`
`echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list`
`sudo apt-get update`
Note if the command is not being initiated, hit **Enter**
2016-08-03 23:29:17 +00:00
`echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" |
sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list`
2016-08-03 22:42:31 +00:00
2016-08-05 17:35:47 +00:00
####Mono on Debian 8 and later
2016-08-03 22:42:31 +00:00
2016-08-03 23:29:17 +00:00
`echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" |
sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list`
2016-08-03 22:42:31 +00:00
2016-08-05 17:35:47 +00:00
####Mono on CentOS 7, Fedora 19 (and later) and later
2016-08-03 22:42:31 +00:00
`yum install yum-util`
`rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"`
`yum-config-manager --add-repo http://download.mono-project.com/repo/centos/`
2016-08-05 17:35:47 +00:00
####Mono Devel
2016-08-03 22:42:31 +00:00
`apt-get install mono-devel`
**Type** `y` **hit Enter**
2016-08-05 16:55:08 +00:00
####Mono Fix
2016-08-03 22:42:31 +00:00
**In case you are having issues with Mono where you get a random string and the bot won't run, do this:**
`sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF`
`echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list`
`apt-get install ca-certificates-mono`
`mozroots --import --sync`
2016-08-05 16:55:08 +00:00
####Installing Opus Voice Codec
- Opus Voice Codec
`sudo apt-get install libopus0 opus-tools`
**Type** `y` **hit Enter**
`sudo apt-get install libopus-dev`
2016-08-03 22:42:31 +00:00
####FFMPEG
`apt-get install ffmpeg`
**Type** `y` **hit Enter**
NOTE: if its "not installing" then, follow the guide here: [FFMPEG Help Guide][FFMPEG Help Guide]
**All you need to do, if you are running UBUNTU 14.04 is initiate these:**
`sudo add-apt-repository ppa:mc3man/trusty-media`
`sudo apt-get update`
`sudo apt-get dist-upgrade`
*Before executing* `sudo apt-get install ffmpeg`
**If you are running Debian 8 Jessie, please, follow these steps:**
`wget http://luxcaeli.de/installer.sh && sudo bash installer.sh` (Thanks to Eleria<3)
In case you are not able to install it with installer ^up there, follow these steps:
`sudo apt-get update`
`echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/debian-backports.list`
`sudo apt-get update`
`sudo apt-get install ffmpeg -y`
####Uncomplicated Firewall UFW
2016-08-05 16:55:08 +00:00
- Install UFW
2016-08-03 22:42:31 +00:00
`apt-get install ufw`
**it is most likely to have it already installed so if you see it is already installed, check with following command, and/or enable it**
`ufw status`
`ufw enable`
**Type** `y` **hit Enter**
`sudo ufw allow ssh`
2016-08-05 16:55:08 +00:00
####Installing Unzip
2016-08-03 22:42:31 +00:00
`apt-get install unzip`
2016-08-05 16:55:08 +00:00
####Installing TMUX
2016-08-03 22:42:31 +00:00
`apt-get install tmux`
**Type** `y` **hit Enter**
####Importing certs
2016-08-05 16:55:08 +00:00
2016-08-03 22:42:31 +00:00
`certmgr -ssl https://discordapp.com`
`certmgr -ssl https://gateway.discord.gg`
Type `yes` and hit Enter **(three times - as it will ask for three times)**
2016-08-05 16:55:08 +00:00
####Creating Nadeko folder
- Create a new folder “nadeko” or anything you prefer
2016-08-03 22:42:31 +00:00
`mkdir nadeko`
2016-08-05 16:55:08 +00:00
- Move to “nadeko” folder (note `cd --` to go back the directory)
2016-08-03 22:42:31 +00:00
`cd nadeko`
####Getting NadekoBot from Releases
Go to this link: [Releases][Releases] and **copy the zip file address** of the lalest version available,
it should look like `https://github.com/Kwoth/NadekoBot/releases/download/vx.xx/NadekoBot.vx.x.zip`
Get the correct link, type `wget`, then *paste the link*, then hit **Enter**.
`wget https://github.com/Kwoth/NadekoBot/releases/download/vx.xx/NadekoBot.vx.x.zip`
**^Do not copy-paste it**
Now we need to `unzip` the downloaded zip file and to do that, type the file name as it showed in your screen or just copy from the screen, should be like ` NadekoBot.vx.x.zip`
`unzip NadekoBot.vx.x.zip`
**^Do not copy-paste it**
####Setting up NadekoBot
- Open **CyberDuck**
- Click on **Open Connection** (top-left corner), a new window should appear.
- You should see **FTP (File Transfer Protocol)** in drop-down.
- Change it to **SFTP (SSH File Transfer Protocol)**
- Now, in **Server:** paste or type in your `Digital Ocean Droplets IP address`, leave `Port: 22` (no need to change it)
- In **Username:** type `root`
- In **Password:** type `the new root password (you changed at the start)`
- Click on **Connect**
- It should show you the new folder you created.
- Open it.
2016-08-05 17:35:47 +00:00
####Renaming Credentials.json
2016-08-03 22:42:31 +00:00
- Copy the `credentials_example.json` to desktop
2016-08-05 17:35:47 +00:00
- EDIT it as it is guided here: [Setting up Credentials.json](Windows Guide.md#setting-up-credentialsjson-file)
- Read here how to [Create DiscordBot application](https://github.com/miraai/NadekoBot/blob/dev/docs/guides/Windows%20Guide.md#creating-discordbot-application)
- Rename it to `credentials.json` and paste/put it back in the folder.
2016-08-03 22:42:31 +00:00
- You should see two files `credentials_example.json` and `credentials.json`
2016-08-05 17:35:47 +00:00
- Also if you already have nadeko setup and have `credentials.json`, `config.json`, `nadekobot.sqlite`, and `"permissions" folder`, you can just copy and paste it to folder.
2016-08-03 22:42:31 +00:00
####Running NadekoBot
2016-08-05 16:55:08 +00:00
- Type/ Copy and hit **Enter**.
2016-08-03 22:42:31 +00:00
`tmux new -s nadeko`
2016-08-03 23:29:17 +00:00
**^this will create a new session named “nadeko”** `(you can replace “nadeko” with anything you prefer and remember
2016-08-05 17:35:47 +00:00
its your session name) so you can run the bot in background.`
2016-08-05 16:55:08 +00:00
- Enter your Nadeko folder
2016-08-03 22:42:31 +00:00
`cd nadeko`
2016-08-05 16:55:08 +00:00
- Start NadekoBot with mono
2016-08-03 22:42:31 +00:00
`mono NadekoBot.exe`
**CHECK THE BOT IN DISCORD, IF EVERYTHING IS WORKING**
Now time to **move bot to background** and to do that, press **CTRL+B+D** (this will ditach the nadeko session using TMUX), and you can finally close PuTTY now.
Copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in this link: `https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303` with it. Go to that link and you will be able to add your bot to your server.
2016-08-05 17:35:47 +00:00
Or check this guide also [Inviting your bot to your server](Windows Guide.md#inviting-your-bot-to-your-server)
2016-08-03 22:42:31 +00:00
**NOW YOU HAVE YOUR OWN NADEKO BOT** `Thanks to Kwoth <3`
####Some more Info (just in case):
-If you want to **see the sessions** after logging back again, type `tmux ls`, and that will give you the list of sessions running.
-If you want to **switch to/ see that session**, type `tmux a -t nadeko` (**nadeko** is the name of the session we created before so, replace **“nadeko”** with the session name you created.)
-If you want to **kill** NadekoBot **session**, type `tmux kill-session -t nadeko`
####Updating Nadeko
2016-08-05 17:35:47 +00:00
**If you want to update your NadekoBot** just follow the steps from [Getting NadekoBot](https://github.com/miraai/NadekoBot/blob/dev/docs/guides/Linux%20Guide.md#creating-nadeko-folder)
2016-08-03 22:42:31 +00:00
`IF YOU FACE ANY TROUBLE ANYWHERE IN THE GUIDE JUST FIND US IN NADEKO'S DISCORD SERVER`
[Linux Setup Video]: https://www.youtube.com/watch?v=icV4_WPqPQk&feature=youtu.be
[Releases]: https://github.com/Kwoth/NadekoBot/releases
[FFMPEG Help Guide]: http://www.faqforge.com/linux/how-to-install-ffmpeg-on-ubuntu-14-04/
[Mono Source]: http://www.mono-project.com/docs/getting-started/install/linux/
[DigitalOcean]: http://m.do.co/c/46b4d3d44795/