-
-
Notifications
You must be signed in to change notification settings - Fork 9
Linux Installation
Kozejin edited this page Dec 2, 2024
·
5 revisions
- Update the package list.
sudo apt update
- Install the dependencies.
sudo apt install python3.11 python3.11-venv python3.11-dev git virtualenv nano
- Create a new user and switch to it.a
sudo adduser palbot
sudo usermod -aG sudo palbot
su - palbot
- Clone the Palworld bot repository with the following commands
git clone https://github.com/dkoz/palworld-bot
cd palworld-bot
- Now you need to create a virtual env and install the requirements.
virtualenv venv
source venv/bin/activate
pip install setuptools
pip install -r requirements.txt
- Configure the environment variables and server configuration.
cp .env.example .env
nano .env
- Now run the bot.
python main.py
- Create a service file.
sudo nano /etc/systemd/system/palbot.service
- Paste the following contents and save the file.
Shortcuts:
ctrl+o
and hit enter, thenctrl+x
to exit.
[Unit]
Description=Palworld Bot
After=network.target
[Service]
User=palbot
Group=palbot
WorkingDirectory=/home/palbot/palworld-bot
ExecStart=/home/palbot/palworld-bot/venv/bin/python -u main.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
- Reload systemd configuration.
sudo systemctl daemon-reload
- Enable the service, then start it.
sudo systemctl enable palbot.service
sudo systemctl start palbot.service
- Then check the status of the Palworld bot or journal logs.
sudo systemctl status palbot.service
sudo journalctl -eu palbot.service
- Switch to the bot user and cd into the directory.
su - palbot
cd palbworld-bot
- Pull the latest changes and run the requirements again.
git pull
source venv/bin/activate
pip install -r requirements.txt
- Restart the bot and verify that it's running.
sudo systemctl restart palbot.service
sudo systemctl status palbot.service
sudo journalctl -eu palbot.service