AXHOST / GUIDES

How to deploy a Discord or Telegram bot

AxHost team · Updated 5 November 2026

This guide is for your own Node.js or Python project. AxHost provides an application runtime, not a ready-made bot or token. First check that your project works on your computer, and note the runtime version, entry file and required variables.

1. Prepare your project and dependencies

For Node.js, keep package.json, the dependency lockfile and an entry file such as index.js in the project root. The scripts field in package.json may contain a start command. Check whether your project uses CommonJS or ES modules: import requires the appropriate project configuration. Do not mix require and import just to work around one error.

For Python, list libraries in requirements.txt with versions you have actually tested. Your entry file might be bot.py. Do not upload the virtual environment from your computer: it contains paths and files for another system. Likewise, avoid copying node_modules between operating systems.

2. Create a service and upload files

Create a service in the client panel, choose Discord or Telegram, and select the runtime matching your code. Upload source files using the file manager or SFTP. After extracting an archive, check that the entry file is not one directory deeper than your startup command expects.

The free plan is for a small project: one server per account, 128 MB RAM and 25% of one CPU core. Some large libraries can exceed the limit during installation, before the bot starts. Reduce your dependencies first; repeatedly restarting will not solve the same problem.

3. Keep your token out of source code

Create your Discord token in the official Developer Portal, or obtain a Telegram token from the official BotFather. Store it in private configuration or an environment variable read by your application. The variable name must match your code; BOT_TOKEN is only a common example, not a variable AxHost automatically creates.

Never post your token in public chat, include it in console screenshots or commit it to a public repository. If it leaks, revoke it with the provider and configure a new token. Deleting a message or the latest commit does not secure the old token.

4. Check the startup command

A typical direct command is node index.js or python bot.py. Only use it if it matches your runtime and actual filename. Linux filenames are case-sensitive: Bot.py and bot.py are different files. If the panel provides an entry-file field, fill it in according to that runtime’s instructions.

Install dependencies using the process for your selected runtime in the panel. If a module is missing, check the dependency list and installation output first. Changing the startup command cannot replace a missing library.

5. Test in the console and on the platform

Watch the first messages after starting. A Running process does not necessarily mean the bot has logged in successfully. Test one simple command on a test server or in a private Telegram chat. On Discord, check the permissions granted during the invite and any intents your features need.

Before deploying again, download a copy of your working version. Change one thing at a time. If it crashes, record the time and final error lines without tokens. For further steps, see the memory and operations guide.

Questions about this guide? Ask on our community Discord →