::: warning
:egg: This guide is not actively maintained. It is accurate as of **Nov 2022**. It will eventually need to be updated by someone else when new hosting features are added.
:::
[Setup Guide]: https://hackmd.io/@goonstation/docs/%2F%40goonstation%2Fdev
# Goonstation Private Server Guide
Setting up a private server running Goonstation is a little tricky. It is recommended you familiarize yourself with internet hosting in general. Specifically, *port forwarding* and the basics of the *internet protocol*.
## Do you need one?
However, while there are many reasons for you to setup your own server, sometimes those reasons are not very good. You probably **don't want to host your own server**:
- If you want to teach friends how to play the game, the best way is to play the real server. Goonstation has an excellent team of mentors always willing to help new and old players alike with questions. They are quite literally one push of <kbd>F3</kbd> away!
- If you want to experiment with features like chemistry, engineering or genetics on your own, you **do not** need to follow this guide to get a server up and running. You can follow the normal [Setup Guide] and use the built-in development server instead.
- If you want to host a large amount (20+) of players or start your own downstream of goon, this guide will not result in a setup best tuned for a high population or a fledgling fork.
## Server Configuration Guide
*[production mode]: Mode of operation for a server which disables many tools which are useful in development, but cause lag when left enabled.
Firstly, if you have not already, you must **read and complete the first section** of the [Setup Guide], titled "*So, how do I get started?*" before you can continue this guide.
:::warning
:no_entry: This section covers servers which **do not modify** any browser assets, or icons. This section works best for servers which do not modify the code whatsoever and stay as up-to-date with upstream goonstation as possible.
:::
:::warning
This guide assumes you have **File name extensions** enabled. They can be enabled from the `View` tab inside of Window's File Explorer.

:::
### Admin Configuration
By default, Goonstation servers do not have any admins when run from DreamDaemon. You must specify who will be admin on your server.
1. Navigate to the `config` folder.
2. Rename the `admins.sample.txt` file to `admins.txt`
3. Open `admins.txt`
4. Follow the instructions in the file.
::: info
When adding your username to the `admins.txt` file, keep in mind
that your username should be formatted in a specific way. For example, if
your username was `Mr. RobotFace40`, your username should be written as `mrrobotface40`.
:::
The two most common ranks you are likely to assign are
- **Host**: Access to all admin powers, and most able to instantly crash everything.
- **Administrator**: Access to gimmicks, logs, bans and plenty of other awesome toys.
### Web Content Setup
Goonstation makes extensive use of browser-based interfaces for interactive
machines and components of the game interface, such as the chat box and the character customization menu. By default, the server will send the assets and images for these interfaces through a **slow and laggy process** that can take upwards of 10 minutes after joining for players to have a normal experience.
Enabling production mode and specifying a website where these assets can be accessed from solves this problem. To do this, you must first create a `config.txt` file.
:::info
Goonstation provides a website which hosts browser assets for the main servers. These websites however **only serve the latest version** of these assets. If you **do not frequently update your copy of the code**, then there is a high chance the assets hosted by Goonstation will **stop working**.
:::
1. Navigate to the `config` folder.
2. Rename the `config.sample.txt` file to `config.txt`
3. Open `config.txt`
4. Near the bottom of the file, change the `ENV` setting from `dev` to `prod`

5. Save `config.txt`
### DreamDaemon
When running a server for multiple players, you should use the DreamDaemon program provided by BYOND. If you are on Windows, the DreamDaemon program should be in your Start Menu, just search for it.
:::info
When running from DreamDaemon, you **must** change the Security level to `Trusted` in order to avoid hundreds of evil permission prompts which will take ages to disappear.
:::
1. Compile goonstation. Assuming you followed the [Setup Guide] all you need to do is press <kbd>F5</kbd> in Visual Studio Code.
2. Open DreamDaemon.
3. Select the `goonstation.dmb` file.
4. Ensure Security is set to 'Trusted'
5. Optionally, pick an unused port number. By default it is `0`, which picks a random unused port number.
6. Optionally, change the visibility. Invisible means your server will not be listed on the BYOND website, while visible means it will.
7. Click Go!

More specific instructions for compiling and using DreamDaemon are available in the [Setup Guide], in the section titled "*Testing your code*"
### Common Problems
**Q:** Players only see a white box instead of the chat, or everything is white when they join.
**A:** You did not properly follow the **Web Content Setup** section. Make sure to restart the server after following the steps.
**Q:** The server restarted and my admin powers are gone!
**A:** This is a known problem. You need to rejoin the server to get your powers back.