Docker Installation
How to use Docker to setup a nanos world server.
The Docker setup is maintained by the community. For more details, visit the open source GitHub repository: nanos-world-server Docker.
You can run nanos world server in a containerized environment using Docker. This method works on any system that supports Docker (Linux, Windows, macOS).
Prerequisites
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- At least 100MB of free disk space
Quick Start with Docker Compose
1. Create a docker-compose.yml file:
services:
nanos-world-server:
image: olivatooo/nanos-world-server:latest
restart: unless-stopped
# Uncomment to always have the latest version
# pull_policy: always
ports:
- "7777:7777/udp"
- "7777:7777/tcp"
- "7778:7778/udp"
volumes:
- ./Packages:/app/Packages
- ./Assets:/app/Assets
- ./logs:/app/.logs
# Uncomment and modify to pass parameters to the server
# command: ["--port", "7777", "--map", "default-testing-map"]
Port 7777 is the game port (UDP) and the built-in HTTP server (TCP), and 7778 (UDP) is the query port used by the Server List.
2. Start the server:
docker compose up -d
3. View logs:
docker compose logs -f
4. Stop the server:
docker compose down
If you are using an older Docker installation, use docker-compose (with a hyphen) instead of docker compose.
Using Docker CLI
Alternatively, you can run the server directly with Docker:
docker run -p 7777:7777/udp -p 7777:7777/tcp -p 7778:7778/udp olivatooo/nanos-world-server
Configuration
You can pass server parameters by modifying the command section in docker-compose.yml:
command: ["--max_players", "32", "--announce", "1", "--game_mode", "sandbox"]
All available parameters are listed in Server Configuration.
By default the server runs as the Playtest Steam App. To change it, pass "--steam_app", "game" in the command.
Dados persistentes
The Docker configuration above mounts these folders from your host into the container (/app):
./Packagesand./Assets: add your custom Packages and Asset Packs, they are kept between container restarts./logs: the server logs
The Config.toml lives inside the container and is recreated with the image, so pass your settings through the command parameters instead.
Updating the Server
To update to the latest version:
docker-compose pull
docker-compose up -d