Dedicated Server
Use when building dedicated servers, headless export, server architecture, lobby...
Install
npx skills add jame581/GodotPrompter --skill dedicated-server -g -a claude-code -y- Repository
- jame581/GodotPrompter914
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Use when building dedicated servers, headless export, server architecture, lobby management, and deployment
Dedicated Server in Godot 4.3+
All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, C# follows.
Related skills: See multiplayer-basics for ENet setup, RPCs, and authority model. See multiplayer-sync for state synchronization and interpolation.
1. Headless Export
A dedicated server runs without a display, GPU, or audio device. Godot supports this through the --headless flag and a dedicated export preset.
--headless Flag
Pass --headless on the command line to suppress the display and audio drivers at runtime:
./my_game.x86_64 --headless
--headless is a runtime flag that works on any exported binary. Godot 4 has no separate server platform or server export template: a dedicated-server export uses the regular template, so the binary keeps its rendering code (a smaller binary needs a custom-compiled template). What the export changes is the PCK and a feature tag, see below.
Server Export Preset
In the Godot editor, create a dedicated Linux export preset:
- Open Project → Export.
- Add a Linux preset and name it
Linux Server. - On the Resources tab, set Export Mode to Export as dedicated server. This adds the
dedicated_serverfeature tag, which makes the binary start with the headless display and dummy audio drivers even without--headless, and marksres://as Strip Visuals: visual resources are exported as placeholders (e.g. a texture keeps only its size). Set folders the server needs intact to Keep. - Use the Exclude filter on the same tab to drop client-only files (audio, client-only scenes) from the server PCK entirely.
Feature Tags
Use OS.has_feature() to branch between server and client code at runtime. Define a custom server feature on the export preset's Features tab (Custom (comma-separated) field) or rely on the built-in dedicated_server feature that a dedicated-server export sets automatically:
