# Basic Setup Guide

## <mark style="color:blue;">Hosting Options</mark>

{% hint style="info" %}
**There is no such thing as absolutely free hosting!**

Either your information is the payment, or your feature set is extremely limited! Be careful for scams, obscure hosting plans, or sneaky payment systems and plans!
{% endhint %}

#### <mark style="color:orange;">Self Hosting</mark>

If you're looking to host a tiny instance, or something that's not critical to keep online all the time, you're more than welcome to run it on your local machine!

#### <mark style="color:orange;">VPS/KVM/VDS Systems</mark>

There's many services that host systems that you could use for this! Hostinger, DigitalOcean, Contabo, etc.! These are much more in depth due to you needing knowledge of how to manage the system.

#### <mark style="color:orange;">Pterodactyl Panel</mark>

The most "plug and play" out of them all! This is the most popular option since this panel lets you do anything from Console Management, File Management, and more! Something like SparkedHost comes to mind!<br>

## <mark style="color:blue;">Configuration</mark>

{% hint style="info" %}
This configuration happens in the <mark style="color:green;">**`common.json`**</mark> file stored at the root of the bot directory.
{% endhint %}

{% hint style="warning" %}
**You may need to enable&#x20;*****Developer Mode*** **if you haven't already for this process!**

To **enable** it, go to: *Discord Settings* > *Advanced* > *Developer Mode*
{% endhint %}

#### <mark style="color:orange;">**1. Get your License!**</mark>

All customers need to have a license! This is to allow your bot to communicate with our API and support neat features like global bans, Lavalink services, and some other things! Plus, it helps us protect our product.

If you need a license, open a ticket in our [Support Server](https://discord.iynxdev.com/)!<br>

#### <mark style="color:orange;">**2. FOR PTERODACTYL ONLY: Change your .json file format!**</mark>

Pterodactyl does not support colored .json5 files within your editor. Due to this make sure to set json5 to false if your host is running pterodactyl.<br>

#### <mark style="color:orange;">**3. Set your Bot Token!**</mark>

For this, you'll have to look in the Discord Developer Portal!

<mark style="color:purple;">For new bots</mark>, you need to create an Application, go to Bot, then press the Reset Token button to generate a new token.

<mark style="color:purple;">For those with an older version of Athena</mark>, you can just copy over your current token into the new configuration file.

If you need help finding how to make one, [I'll link that here](https://www.youtube.com/watch?v=dHuWTYRrhDc)!<br>

#### <mark style="color:orange;">**4. Set your MongoDB URI!**</mark>

This is what lets your bot save data! [The process for that is here](https://www.youtube.com/watch?v=XARrj4hJSD0)!<br>

#### <mark style="color:orange;">**5. Set your Discord Bot ID!**</mark>

Without this, your bot doesn't know which account to interface with.

You need to have Discord's Developer Mode enabled if you haven't yet! It's pretty simple to get it, just right click your bot user and 'Copy ID'.<br>

#### <mark style="color:orange;">**6. Set your Discord Server ID!**</mark>

This is the Server your bot is in! (Right-click your server icon to get it)<br>

#### <mark style="color:orange;">7. Set your server name!</mark>

This is for your bot's reference in regards to your server name in it's messages.<br>

#### <mark style="color:orange;">8. Set your server color!</mark>

This just makes your embeds correlate to the color you wanted to see the most, so choose whatever you want here.<br>

#### <mark style="color:orange;">9. Set your language!</mark>

This is the language the bot responds in on Discord.

* English: <mark style="color:green;">**`en`**</mark>
* German: <mark style="color:green;">**`de`**</mark>
* Spanish: <mark style="color:green;">**`es`**</mark>
* French: <mark style="color:green;">**`fr`**</mark>
* Portugese: <mark style="color:green;">**`pt`**</mark>
* Dutch: <mark style="color:green;">**`nl`**</mark>
* Turkish: <mark style="color:green;">**`tr`**</mark>
* Russian: <mark style="color:green;">**`ru`**</mark>
* Polish: <mark style="color:green;">**`pl`**</mark>

#### <mark style="color:orange;">10. Set your timezone!</mark>

This is the timezone the bot will use for time-based operations and logging. Use standard timezone identifiers (e.g., "Europe/Berlin", "America/New\_York").<br>

#### <mark style="color:orange;">11. Dashboard!</mark>

{% hint style="danger" %}
The dashbard is currently in closed beta. Please do not enable the setting if you do not have beta access, the bot won't start otherwise. The setup guide for the dashboard can be found in our Discord server for now.
{% endhint %}

***

After everything is done, it should look something similar to below!

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "general": {
        "license": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
        "json5": false,
        "lang": "en",
        "timezone": "Europe/Berlin"
    },
    "bot": {
        "mongodb_uri": "URI KEY HERE",
        "discord_bot_token": "BOT TOKEN HERE",
        "discord_bot_id": "BOT ID HERE",
        "discord_guild_id": "SERVER ID HERE",
        "server_name": "SERVER NAME HERE",
        "server_color": "YOUR FAVORITE COLOR IN HEX HERE"
    },
    "dashboard": {
        "enabled": false,
        "port": 3222,
        "disable_dashboard_configuration": false,
        "sync_dashboard_configs_to_file": false,
        "whitelisted_user_ids": [
            "USER_ID_HERE"
        ]
    },
    "console": {
        "logs_include_date": true,
        "logs_to_file": true,
        "logs_include_dashboard_output": true,
        "maximum_log_file_count": 20
    },
    "util": {
        "register_commands": true,
        "prevent_duplicated_message": false,
        "backup_configs_on_startup": false,
        "maximum_config_backup_count": 10,
        "auto_restart": true,
        "auto_restart_every": "7d",
        "debug": false,
        "developer_mode": false
    },
    "updater": {
        "auto_update": true,
        "create_system_backup_before_update": true,
        "maximum_backup_count": 10,
        "plugin_bypass": [],
        "delay_restart_in_seconds": 60,
        "dev_builds": false
    }
}
</code></pre>

{% hint style="success" %}
**Congrats! You're all set on this part!**

But we're not done yet!
{% endhint %}

***

## <mark style="color:blue;">Installing Dependencies</mark>

### <mark style="color:yellow;">Pterodactyl Setup</mark>

{% hint style="danger" %}
[**The egg is available here!**](https://github.com/gsrvtech/gameserver-templates/tree/main/bots/athenabot) **(or at the pterodactyl-eggs directory)**

You need to install this with your admin panel!

\
**WARNING:** This egg is not compatible with all system setups. If you encounter any issues please consider using a different egg from the web that supports Node.js v22.
{% endhint %}

{% hint style="warning" %}
Make sure to install [Node 22.21.0 (LTS Preferred)](https://nodejs.org/en/download/package-manager) on your panel!
{% endhint %}

### <mark style="color:yellow;">Self-Host/Non-Pterodactyl Setup</mark>

#### <mark style="color:orange;">Linux (Ubuntu/Debian) Manual Installation</mark>

* [ ] <mark style="color:purple;">**Open a terminal**</mark> in your Athena bot folder.
* [ ] <mark style="color:purple;">**Run**</mark> <mark style="color:green;">**`sudo apt-get update`**</mark>
* [ ] <mark style="color:purple;">**Run**</mark> <mark style="color:green;">**`sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev`**</mark> to install Canvas/native build requirements.
* [ ] <mark style="color:purple;">**Run**</mark> <mark style="color:green;">**`npm install`**</mark> to install Node packages.
* [ ] <mark style="color:purple;">**Start the bot**</mark> using <mark style="color:green;">**`node index.js`**</mark>

#### <mark style="color:orange;">Windows Manual Installation</mark>

* [ ] <mark style="color:purple;">**Open CMD or PowerShell**</mark> in your Athena bot folder.
* [ ] <mark style="color:purple;">**Run**</mark> <mark style="color:green;">**`npm install`**</mark> to install Node packages.
* [ ] <mark style="color:purple;">**If Canvas fails to install**</mark>, install <mark style="color:green;">**Visual Studio Build Tools (Desktop development with C++)**</mark> and <mark style="color:green;">**Python 3**</mark>, then run <mark style="color:green;">**`npm install`**</mark> again.
* [ ] <mark style="color:purple;">**Start the bot**</mark> using <mark style="color:green;">**`node index.js`**</mark>

{% hint style="info" %}
**For Bot Persistence even after closing the CMD Prompt window:**

<mark style="color:purple;">**Linux:**</mark>

Install PM2 once with <mark style="color:green;">**`npm install pm2 -g`**</mark>, then use <mark style="color:green;">**`pm2 start index.js --name Athena`**</mark> to keep your bot alive.

And use <mark style="color:green;">**`pm2 stop Athena`**</mark> to turn it back off!\
\ <mark style="color:purple;">**Windows:**</mark>

PM2 is primarily documented here for Linux hosts. For Windows, use the startup batch script below (or Windows Task Scheduler) for persistence.

This script allows you to keep AthenaBot online even after restarts. This batch script was made by <mark style="color:red;">**@.dodgeman**</mark> (334154279029833728)

```batch
@echo off
chcp 65001 >nul
cls

REM CONFIGURATION FOR SCRIPT, SHOULD ONLY NEED TO CHANGE THIS SECTION, NOTHING BELOW.

REM This is set to the path wherever your bot resides.

set "ATHENA_PATH=C:\Users\myusername\Desktop\Athena Bot" 


REM NOTHING BELOW HERE SHOULD NEED CHANGING UNLESS YOU NEED TO TWEAK OR ADD SOMETHING ELSE. WORKS AS IS.


set "RESTARTED=0"

:START
cls
if %RESTARTED% equ 0 (
    ECHO.      ╔════════════════════════════════════════╗
    ECHO.      ║                                        ║
    ECHO.      ║      Starting Athena Discord Bot       ║
    ECHO.      ║                                        ║
    ECHO.      ╚════════════════════════════════════════╝
) else (
    ECHO.      ╔════════════════════════════════════════╗
    ECHO.      ║                                        ║
    ECHO.      ║     RE-Starting Athena Discord Bot     ║
    ECHO.      ║                                        ║
    ECHO.      ╚════════════════════════════════════════╝
)

ECHO.
ECHO.

cd /d "%ATHENA_PATH%"
echo Starting AthenaBot...
ping -n 2 127.0.0.1 >nul
node index.js

ping -n 4 127.0.0.1 >nul

if %errorlevel% equ 2 exit

set "RESTARTED=1"
goto START
```

{% endhint %}

## <mark style="color:blue;">Finalizing Setup</mark>

{% hint style="info" %}
If you edit Athena files locally in Visual Studio Code, install the <mark style="color:green;">**JSON5 Syntax**</mark> extension so your <mark style="color:green;">**`.json5`**</mark> config files are color-highlighted and easier to read.
{% endhint %}

* [ ] <mark style="color:purple;">**Start the Bot!**</mark> This will create all necessary configuration files for you to edit!
* [ ] <mark style="color:purple;">**Stop the Bot!**</mark>
* [ ] <mark style="color:purple;">**Configure everything!**</mark> All configuration files can be found in your /configuration folder!
* [ ] <mark style="color:purple;">**Restart the Bot!**</mark>
* [ ] <mark style="color:purple;">**Enjoy!**</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iynxdev.com/getting-started/basic-setup-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
