NEU 📢 Spare bis zu 30 % im ersten Monat – nur für kurze Zeit!

How to deploy and update your Discord bot from GitHub

Discord bot hostingUpdated Oct 6, 20263 min read

If your bot lives in a git repository, you do not have to upload files by hand. The server can download it and pull your newest code each time it starts.

Set it up

  1. Open your bot server in the panel, then Settings, then Game Settings.
  2. Fill in Git repository with the address, for example https://github.com/you/your-bot.
  3. Optionally set Git branch if you do not use the default branch.
  4. Paste your token into Discord bot token and check Main file (or the Python file) is the file that starts your bot.
  5. Start the server from Console. On the first start, while the folder is empty, the server downloads the repository, installs the packages and starts the bot.

If the folder already has files, the download is skipped so nothing is overwritten. Delete the files first, or use Update from git on every start with a folder that already holds a checkout.

Private repositories

For a private repository fill in Git username and Git access token.

  • On GitHub, create a fine-grained personal access token limited to that one repository with read-only Contents permission.
  • Use it as the access token. Use your GitHub user name as the git username.
  • The token is a password. Anyone you invite to the server can see its settings.

Update on every restart

Open Show advanced and switch on Update from git on every start. Each start then runs git pull before your bot launches. To release a change: push to the branch, then restart the server from Console.

If an update fails

  • Read the first lines of Console: a git error such as Authentication failed means the token is wrong or expired.
  • If you changed files on the server by hand, git pull can refuse to overwrite them. Keep changes in the repository and not on the server.
  • The server installs package.json or requirements.txt packages on each start, so new packages in your commit are picked up.

Related: How to host a Node.js Discord bot, How to host a Python Discord bot.

ERSTELLE DEINEN SPIELESERVER
BEREIT, LOSZULEGEN?

Spare bis zu 30% auf deinen neuen Gameserver.
Premium-Performance, sofortige Aktivierung und unschlagbare Zuverlässigkeit. Alles zum besseren Preis.

UNSERE NEUESTEN BLOGS