# Godot dedicated server export checklist

> Export a Linux x86_64 preset with the Export as dedicated server mode, start it with --headless, create your ENet or WebSocket peer on a fixed port, and test a real client before packing. Godot adds the dedicated_server feature tag for you.

*NetCraftGames (NCG) by Charging Bull Software. Last updated: 2026-10-03. Canonical page: https://netcraftgames.com/guides/godot-dedicated-server-export-checklist/*

## The short answer

Godot's documentation says to open the server export preset, go to the Resources tab and pick "Export as dedicated server", which adds the `dedicated_server` feature tag automatically. Since Godot 4.0, any binary can also run without a window using `--headless`. Pair that with a fixed port and an honest test and you have a server a host can run.

## Detect server mode in code

Godot gives you three ways to know you are the server:

```gdscript
func _ready() -> void:
    if OS.has_feature("dedicated_server"):
        start_server()
    elif DisplayServer.get_name() == "headless":
        start_server()
    elif "--server" in OS.get_cmdline_user_args():
        start_server()
```

Use one on purpose. A server that quietly starts as a client waits forever for a window.

## ENet or WebSocket?

| | ENet | WebSocket |
| --- | --- | --- |
| Protocol | UDP | TCP (WebSocket) |
| Browser web export | Not possible | Yes, over `wss://` |
| Latency under packet loss | Better | Worse |
| Peer class | `ENetMultiplayerPeer` | `WebSocketMultiplayerPeer` |

Native-only games should use ENet. Games with browser players need WebSocket or WebRTC. Read [WebSocket vs UDP](https://netcraftgames.com/guides/websocket-vs-udp-browser-multiplayer/).

## The checklist


1. **Match versions.** Install export templates that match your editor version exactly, and use the same Godot version for client and server.
2. **Create a Linux x86_64 preset.** In Project > Export add a Linux preset and choose the x86_64 architecture.
3. **Choose dedicated server mode.** On the Resources tab pick Export as dedicated server. This adds the `dedicated_server` feature tag and lets you strip visuals.
4. **Start the right peer on a fixed port.** Create `ENetMultiplayerPeer.create_server(port, max_clients)` for UDP or `WebSocketMultiplayerPeer.create_server(port)` for browsers, then assign it to `multiplayer.multiplayer_peer`.
5. **Run it headless on Linux.** Execute `./server.x86_64 --headless`, check the port with `ss`, and join from a real client on another network.
6. **Keep saves under one path.** Write state under `/game/saves` or another single known folder so a shutdown can checkpoint it.
7. **Pack cleanly.** Archive the export folder as `.tar.gz` with no symbolic links and no embedded tokens, then record the SHA-256 of the file you will upload.


## Stripping the export

The export dialog lets each resource be exported with visuals replaced by placeholders, kept, or removed. Stripping textures and materials on the server shrinks the package and memory. Do not strip anything your server logic reads, such as collision shapes, navigation data or scene scripts.

## Test it the way a host will run it

On a Linux x86-64 machine, extract the archive and start the server with the exact command you will declare. Check the port with `ss -lunp` for ENet (UDP) or `ss -ltnp` for WebSocket (TCP), then join from a Godot client on another computer or network. If the server prints errors about missing display or audio drivers, you started the normal binary without the dedicated server tag or `--headless`.

## Common mistakes

| Mistake | Symptom | Fix |
| --- | --- | --- |
| Export templates do not match the editor version | Export fails or the server crashes at start | Install the matching templates from the editor's export dialog |
| Client and server built on different Godot versions | Peers connect, then disconnect or desync | Rebuild both with one version |
| Server created only inside a UI scene | Nothing listens when run headless | Start the peer from an autoload or a scene that runs without a window |
| Stripped a resource the server reads | Missing node or script errors at startup | Mark only visual resources as stripped |
| Hard-coded `127.0.0.1` or a random port | Reachable only locally | Bind the fixed declared port on all interfaces |
| Saved files written next to the executable | Lost on shutdown | Write under one declared save folder |

## What a host needs from you

A declared start command such as `/game/server.x86_64 --headless`, the port and protocol (UDP for ENet, TCP for WebSocket), a health reply and, ideally, a join probe. The [connection config guide](https://netcraftgames.com/guides/connection-config-file-contents/) lists each field, and the [Godot ENet](https://netcraftgames.com/engines/godot-enet/) and [Godot WebSocket](https://netcraftgames.com/engines/godot-websocket/) pages cover the hosting side.

## Frequently asked questions


### How do I run a Godot server without a window?

Start the exported binary with the --headless command-line argument; since Godot 4.0 this works on any platform. If you export with Export as dedicated server mode, the dedicated_server feature tag is added automatically, which you can test with OS.has_feature, and the project can start in server mode without extra arguments.

## Sources

- [Godot Docs: Exporting for dedicated servers](https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_dedicated_servers.html), accessed 2026-10-03
- [Godot Docs: WebSocketMultiplayerPeer](https://docs.godotengine.org/en/stable/classes/class_websocketmultiplayerpeer.html), accessed 2026-10-03

## Related pages

- [Hosting a Godot ENet dedicated server](https://netcraftgames.com/engines/godot-enet/): Host a Godot 4 ENet dedicated server on NetCraftGames: dedicated server export, headless start, UDP port, health and join probes, and the honest gaps.
- [Hosting a Godot WebSocket multiplayer server](https://netcraftgames.com/engines/godot-websocket/): Host a Godot 4 WebSocket multiplayer server on NetCraftGames for browser and native clients: WebSocketMultiplayerPeer, wss through a gateway, and honest gaps.
- [WebSocket vs UDP for browser multiplayer](https://netcraftgames.com/guides/websocket-vs-udp-browser-multiplayer/): Browsers cannot use raw UDP. Compare WebSocket, WebRTC data channels and native UDP for multiplayer games, and pick the right transport for your players.
