Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wiki.daki.cc/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through deploying a Discord.js bot on Daki Hosting — from creating your server to having your bot online and reading its token securely.

What you’ll learn

  • How to create a Node.js server for your bot
  • How to upload your code
  • How to configure the install command, startup command, and Docker image
  • How to set your bot token securely using a .env file
  • How to start your bot and verify it works

Prerequisites

  • A Daki account (Free Tier or paid) — see Create an Account
  • A Discord bot with a bot token, created in the Discord Developer Portal
  • Your bot’s source code, including a package.json with discord.js and dotenv as dependencies
Discord bots connect outbound to Discord’s servers and do not require an inbound port. This means Discord bots work on both Free Tier and paid plans. If your bot also serves HTTP requests (e.g., for slash command interactions or webhooks), you will need a paid plan, as publicly accessible ports are only available on paid plans. See Network & Allocations.

Step 1: Create a Node.js Server

  1. Log in to the Free Tier Dashboard at dash.daki.cc or the Billing Panel at billing.daki.cc.
  2. Create a new server and select the Node.js egg.
  3. Give your server a name (e.g., MyDiscordBot).
See Create Your First Server for the full walkthrough.

Step 2: Access the Portal

Log in to the Portal via SSO (from the Credentials tab or your Billing Panel service page), or directly at portal.daki.cc. See Portal Overview.

Step 3: Upload Your Bot’s Code

Option A — Upload as a ZIP (simplest):
  1. Compress your project folder into a .zip file locally.
  2. In the Portal, go to the Files tab and click Upload.
  3. Right-click the .zip and click Extract.
Option B — Use SFTP (no size limits): Connect using your SFTP credentials from the Settings tab and upload your folder directly. See File Manager.
Do not include your node_modules folder in the upload — it will be installed automatically by the install command. Do include your package.json and package-lock.json.

Step 4: Configure the Startup Tab

Open the Startup tab and configure all three fields: 1. Docker Image — Select the Node.js version your bot requires (e.g., Node.js 20 or Node.js 22). Node.js 20 LTS is a safe default if unsure. 2. Install Command — Set this to install your dependencies automatically:
npm install
3. Startup Command — Set this to the command that launches your bot:
  • node index.js — if your entry file is index.js
  • node bot.js — if your entry file is bot.js
  • npm start — if you have a start script in package.json
You are free to adjust these commands to match your project structure. See Startup Settings for a full explanation.

Step 5: Add Your Bot Token via a .env File

Your bot needs its Discord token to connect. Store it in a .env file on the server so it never ends up in your source code.
  1. In the Files tab, click New File and name it .env.
  2. Add your token:
    BOT_TOKEN=your_discord_bot_token_here
    
  3. Click Save.
In your bot code, load it with dotenv:
require('dotenv').config();

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.once('ready', () => {
    console.log(`Logged in as ${client.user.tag}`);
});

client.login(process.env.BOT_TOKEN);
Make sure dotenv is listed in your package.json dependencies so it gets installed by the install command. See Environment Variables for more details on using .env files.

Step 6: Start Your Bot

Click Start in the Console tab. A successful launch will print your bot’s login confirmation:
Logged in as MyBot#1234!
If you see errors instead, check the Troubleshooting guide.

Common Issues

Your dependencies were not installed. Check that your package.json lists discord.js as a dependency, and that the install command is set to npm install in the Startup tab. Restart the server to trigger the install.
Add dotenv to your package.json dependencies and restart the server to reinstall.
Your bot token in the .env file is incorrect or missing. Go to the Files tab, open .env, and verify the value. Make sure there are no extra spaces, quotes, or line breaks.
This is usually caused by missing Gateway Intents. In the Discord Developer Portal, enable the required privileged intents (e.g., Message Content Intent) for your bot application, and ensure your code requests them.
Open the Console tab and read the error. Common causes: wrong startup command (filename typo), wrong Node.js version, or missing node_modules. See Troubleshooting.

Next Steps