> For the complete documentation index, see [llms.txt](https://bothosting-net.gitbook.io/bot-hosting.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bothosting-net.gitbook.io/bot-hosting.net/legacy/setup-server.md).

# Set Up a Server

### Before you start

* Make sure you have created an account - [Create an Account](/bot-hosting.net/legacy/create-account.md)
* Make sure you have created a server - [Create a Server](/bot-hosting.net/legacy/create-server.md)

## Set Up a Server

{% hint style="warning" %}
The Pterodactyl panel, which we use for the control.bot-hosting.net site, does not offer a shell page to run commands. The console does not support them either, so you will not be able to run commands like `npm install discord.js` or `pip install discord.py`. Additionally, uploading modules or packages is **NOT** recommended, as it can create version or software issues. There are different ways to install modules and packages.
{% endhint %}

Now that you have created a server, you should be able to view it on the `Manage Servers` page. Click `Manage Server` on it.

<figure><img src="/files/1s94xsapbr6FMYnek3mT" alt=""><figcaption></figcaption></figure>

You can then view your server in the control panel. This is where you will upload files, start or stop your server, and configure it.

<figure><img src="/files/aicXoDtzuJlLUDCJXeMh" alt=""><figcaption></figcaption></figure>

If this is your first time entering the control panel, you will be prompted to log in with Discord again. Once logged in, you should be able to see your server in the control panel. Select it.

<figure><img src="/files/olQFh9CJRxGIYwOFygEJ" alt=""><figcaption></figcaption></figure>

You should now see your server like this. Along the top, you will see tabs to control different aspects of the server. The first thing you should do is upload your files.

### Upload and Unarchive Files <a href="#e0w5sxsclpw" id="e0w5sxsclpw"></a>

{% hint style="info" %}
If you want to pull files from a Git repository, please refer to [this guide](/bot-hosting.net/legacy/sftp-connection.md) instead.
{% endhint %}

There are 2 ways to upload your files. You only need one:

* **Files tab:** You can upload your files in the server's Files tab.

<figure><img src="/files/l1iBWiva5hvqPNImd86f" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**IMPORTANT:** You should **always** keep the original files on your local device or cloud.\
We are not a cloud storage service: if your server/account is deleted, your files are gone.
{% endhint %}

* **SFTP:** Secure File Transfer Protocol. You can use this method to manage your server files directly from a program on your computer. If you want to use SFTP, you can find your credentials in the `Settings` tab in the control panel navbar for your server.

If you want to upload your files using the Files tab and file selector, click `Files` in the navbar at the top of your server, then click `Upload`.

{% hint style="warning" %}
If you are using Node.js, you do not need to upload your `node_modules` folder, as the server can automatically install your packages as long as you upload your `package.json` file.

If you are using Python, you do not need to upload your `.cache` and `.local` folders, as the server can automatically install your packages as long as you upload your `requirements.txt` file.

You should upload your files in a compressed format such as `.zip` or `.gz`. Once the archive is on the server, click the three dots next to the file and select `Unarchive` to extract it.
{% endhint %}

<figure><img src="/files/YST2dqFV28TYPSp5rxbN" alt=""><figcaption></figcaption></figure>

If you are using an archive, your files will most likely decompress into a folder. You should move your files out of that folder. First, open the folder you just extracted.

<figure><img src="/files/rLaYe7Z7Nl4thEFqzGFu" alt=""><figcaption></figcaption></figure>

Then select all the files using the checkbox next to them. You should now see a menu appear on your server where you can click `Move`.

<figure><img src="/files/HP94fycO83B3J3DRt2ss" alt=""><figcaption></figcaption></figure>

This will open a modal where you can enter the path to move the files to. You can enter a relative path here, so to move the files out of the folder, simply enter `..` to move them back one directory. Then, to complete the move, press Enter or click the move button.

<figure><img src="/files/vRmbidgDCLqaloplw09q" alt=""><figcaption></figcaption></figure>

Finally, you can delete the archive and folder on your server to free up space. Of course, if your files are already out of the folder, you do not need to follow those additional steps.

### Final Configuration <a href="#q5mpitoqo0z" id="q5mpitoqo0z"></a>

You should review the startup configuration, found in the `Startup` tab on your server control panel, before your bot is ready to go. There are some notable configuration options.

You will see an option similar to `Bot <language> file` or `JAR FILE`. This is the file that the server will start with. When developing your bot, you will have a main file that is used to start the bot and import all other files. This is what you must enter here, so make sure it is correct.

{% hint style="info" %}
If the file that starts the bot is not in the main directory and you cannot move it, please specify the path to the file in the field.
{% endhint %}

<figure><img src="/files/qCvQwstEwXZDmfvvRmLD" alt=""><figcaption></figcaption></figure>

Additionally, if you are running a Python or Node.js server, you need to make sure the server knows which modules, packages, or libraries your code requires.

### **Node.js Packages Installation** <a href="#id-0sliscetlmx" id="id-0sliscetlmx"></a>

**There are 2 ways to install Node.js packages:**

1. When you start the server, the startup command checks for a file named `package.json` and installs modules using the names and versions defined in it. There are 2 ways to get that file:

* From the folder where you developed your bot. It is most likely generated by the application you use for coding.
* [Create it manually with this guide](https://docs.npmjs.com/creating-a-package-json-file)

2. In your server control panel, open the `Startup` section. Use `ADDITIONAL NODE PACKAGES` to install extra Node.js packages, separating package names with spaces. **Write only the package name, not the npm command.**

```diff
- npm install package (this can't be used)
+ package
```

### **Common Errors Related to Package Installation** <a href="#c2iqeq5e27f" id="c2iqeq5e27f"></a>

`Error: Cannot find module 'package'`

> This error means the `package.json` file does not contain the package, or there was a problem during installation. Check the errors above.

`npm error 404 Not Found - GET https://registry.npmjs.org/`

> This usually means the package you are trying to install does not exist, you typed it incorrectly, or an error caused the installation to be skipped.

### **Python Modules Installation** <a href="#id-6e752pi312y" id="id-6e752pi312y"></a>

**There are 2 ways to install Python packages:**

1. When you start the server, the startup command checks for a file named `requirements.txt` and installs modules using the names and optional versions defined in it. [requirements.txt file creation guide](https://pip.pypa.io/en/stable/reference/requirements-file-format/)
2. In your server control panel, open the `Startup` section. Use `ADDITIONAL PYTHON PACKAGES` to install extra Python packages, separating package names with spaces.

```diff
- pip install package (this can't be used)
+ package
```

### **Common Errors Related to Package Installation** <a href="#z6xo8w33edw" id="z6xo8w33edw"></a>

`ModuleNotFoundError: no module named 'discord'`

> This usually means that you did not declare the `discord` module in your requirements file, or the server could not install that module because an earlier error occurred.

`ERROR: Could not find a version that satisfies the requirement package (from versions: none)`

> The package you are trying to install does not exist.

Your server should now be ready to go!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://bothosting-net.gitbook.io/bot-hosting.net/legacy/setup-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
