Deploy on Linux
This tutorial will have you deploying discordgsm on Linux server.
This tutorial will have you deploying discordgsm on Linux server.
1. Create a new user
Create a user named discordgsm and switch to that user.
su - discordgsm
2. Clone the repository
Clone GameServerMonitor repository by the following command.
cd GameServerMonitor
git checkout tags/$(git describe --tags)
or download manually: Here
3. Create a Virtual Python Environment
The following commands will create a new virtual environment.
4. Activate the Environment
Now that we have a virtual environment, we need to activate it.
After you activate the environment, your command prompt will be modified to reflect the change.
5. Install Python dependencies and packages
The following commands will download the necessary dependencies and packages.
6. Configure the environment variables
Copy .env.example to .env
Edit .env with your favourite editor. Learn more: Guide: Environment Variables
7. Add the bot to your server
The following commands will start the discord bot.
View the console output and click the bot invite link to add the bot to your server.
8. Create a service
Press Ctrl+C to exit the process, then create a service file.
Paste the following content and save.
Description=Discord Game Server Monitor
After=network.target
[Service]
User=discordgsm
Group=discordgsm
WorkingDirectory=/home/discordgsm/GameServerMonitor
ExecStart=/home/discordgsm/GameServerMonitor/venv/bin/python -u main.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
9. Reload the service daemon
Reload systemd manager configuration.
10. Enable and start the service
Enable automatically get it to start on boot and start the service.
sudo systemctl start discordgsm.service
11. View status of the service
12. View the service console log (Optional)
13. Congratulations! 🎉
DiscordGSM has deployed.
This tutorial will update the application to the latest release version.
1. Activate the Environment
The following commands will change the directory to GameServerMonitor and activate the environment.
source venv/bin/activate
2. Pull the repository
The following commands will pull the latest version.
3. Install Python dependencies and packages
The following commands will download and update the necessary dependencies and packages.
4. Restart the service
The following commands will restart the service.
5. Congratulations! 🎉
DiscordGSM has updated.