This guide covers how to set up your Portal Knights dedicated server on Legion Hosting, configure startup variables, adjust server settings, connect with friends, and manage your world saves. For admin controls and player management, see Portal Knights Admin Commands.
1. First Start
- Log in to GPanel and select your Portal Knights server.
- Go to the Startup tab and review the available variables (see the table below).
- Set a SERVER_NAME so you can identify your server in the browser.
- Change the ADMIN_PASS from the default. Optionally set USER_PASS or GUEST_PASS to restrict access to your group.
- Return to the Console tab and click Start.
- Wait for the console to indicate the server has finished loading. The first start will generate default configuration files and a new world.
2. GPanel Startup Variables
The following variables are available in the GPanel Startup tab. These values are applied each time the server starts.
| Variable | Required | Description |
|---|---|---|
SERVER_NAME |
No | The name displayed in the server browser. Defaults to Servername if not set. Maximum 32 characters. |
ADMIN_PASS |
Yes | Admin password for the server. Default is admin_password_please_change -- you should change this before starting. |
USER_PASS |
No | Password for user-level access. Leave blank for no password. |
GUEST_PASS |
No | Password for guest-level access. Leave blank for no password. |
GAMEMODE |
No | Gameplay mode for the server. Options: Adventure, Creative. Default is Adventure. |
UNIVERSE_SIZE |
No | Universe size for the server. Options: Small, Normal, Large. Default is Normal. |
3. Server Configuration
Beyond the startup variables, Portal Knights allows fine-tuning through its server configuration file. Stop your server before making changes.
Configuration File Location
dedicated_server/server_config.json
Open this file using the Files tab in GPanel or connect via SFTP. If the file does not exist, start and stop the server once to generate it with default values.
Key Settings
The configuration file uses JSON format. Key properties include:
| Setting (JSON path) | Default | Description |
|---|---|---|
basicServerData.name |
Servername |
Display name in the server browser (set via SERVER_NAME startup variable). |
basicServerData.port |
(assigned by GPanel) | Server port. Managed automatically by GPanel. |
basicServerData.saveFolderPath |
./savedata |
Path where world save data is stored. |
admins.credentials.password |
admin_password_please_change |
Admin password (set via ADMIN_PASS startup variable). |
users.credentials.password |
(empty) | User-level password (set via USER_PASS startup variable). |
guests.credentials.password |
(empty) | Guest-level password (set via GUEST_PASS startup variable). |
gameplayMode |
Adventure |
Gameplay mode: Adventure or Creative (set via GAMEMODE startup variable). |
universeSize |
Normal |
Universe size: Small, Normal, or Large (set via UNIVERSE_SIZE startup variable). |
Example Configuration
{
"basicServerData": {
"name": "My Portal Knights Server",
"ipv4": "0.0.0.0",
"port": 27015,
"saveFolderPath": "./savedata"
},
"admins": {
"credentials": {
"password": "my_admin_password"
}
},
"users": {
"credentials": {
"password": ""
}
},
"guests": {
"credentials": {
"password": ""
}
},
"gameplayMode": "Adventure",
"universeSize": "Normal",
"hideConsoleWindow": true
}
4. World Settings
Portal Knights worlds consist of procedurally generated islands connected by portals. Key world-related considerations:
- Save Folder: World data is stored in the
savedatadirectory (configured viabasicServerData.saveFolderPathin the config). - Gameplay Mode: Set via the
GAMEMODEstartup variable.Adventureis the standard RPG experience;Creativeallows free building and exploration. - Universe Size: Set via the
UNIVERSE_SIZEstartup variable. Controls the number of islands:Small,Normal, orLarge. - Island Progression: Players progress through islands by collecting portal shards and activating portals. The server tracks all discovered islands and their states.
5. How to Connect
Option A -- In-Game Server Browser
- Launch Portal Knights via Steam.
- From the main menu, select Multiplayer.
- Choose Online Game and then Browse Servers.
- Search for your server by name or browse the list.
- Select your server and click Join. Enter the password if prompted.
Option B -- Direct Connect via IP
- Launch Portal Knights via Steam.
- From the main menu, select Multiplayer.
- Choose Online Game and then Direct Connect.
- Enter your server IP and port from GPanel's Network tab:
<your-server-ip>:<port> - Enter the server password if one is set.
6. Save Management
Save File Location
World saves are stored on the server at:
dedicated_server/savedata/
This path is configured via the basicServerData.saveFolderPath setting in server_config.json.
Manual Backups via SFTP
- Stop the server from GPanel to ensure all data is flushed to disk.
- Connect to your server via SFTP. See How to Upload Files via SFTP for instructions.
- Navigate to the
dedicated_server/savedata/directory. - Download the entire world folder you want to back up.
Restoring a Save
- Stop the server from GPanel.
- Connect via SFTP and navigate to
dedicated_server/savedata/. - Upload your backed-up world folder, replacing the existing one if needed.
- Ensure the folder name matches the
world_namesetting in your configuration. - Start the server from GPanel.
Troubleshooting
- Server not appearing in browser: Confirm the server is fully started in GPanel. The server browser may take 2-3 minutes to index a new server. Try direct connect via IP in the meantime.
- Cannot connect: Verify your server IP and port in the GPanel Network tab. Ensure the server is running and not in a crashed state.
- Crashes on startup: Delete the configuration file and restart to regenerate defaults. If the issue persists, check the GPanel console for error messages.
- World not loading: Ensure the
basicServerData.saveFolderPathsetting inserver_config.jsonpoints to the correct directory.
Related Articles
- Portal Knights Admin Commands
- How to Find Your Server IP and Port
- How to Upload Files via SFTP
- Server Startup Guide
Need Help?
If you run into issues not covered here, open a support ticket and include your server IP, a description of the problem, and any error messages from the GPanel console.