| name | dedicated-server |
| description | 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
This is distinct from the server platform — --headless is a runtime flag that works on any exported binary. The server export template strips rendering entirely from the binary, reducing its size.
Server Export Preset
In the Godot editor, create a dedicated Linux/X11 (or Linux Server) export preset:
- Open Project → Export.
- Add a Linux/X11 preset and name it
Linux Server.
- Under Options → Binary, enable Export As Dedicated Server (Godot 4.2+). This uses the server export template that omits rendering and audio code.
- Under Resources, use the Exclude list to strip client-only assets (shaders, high-res textures, audio files) from the server PCK.
Feature Tags
Use OS.has_feature() to branch between server and client code at runtime. Define a custom feature in the export preset (Project Settings → Export → Custom Features) or rely on the built-in feature that the server template sets automatically: