Jump to content

Shampan-xyz

Vintarian
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Shampan-xyz

  1. I didn't know that there was another docker vintagestory server, but I didn't see that until I made this one. Mine focuses on docker compose and has a preset config for hosting behind CGNAT. I wasn't sure about posting the image to dockerhub or a release page, because vintage story is proprietary. Instead you'll have to put in the server download link in a .env file. After that docker compuse up -d takes care of the rest. The repo is at: https://codeberg.org/Shampan/vintagestory-server-docker # Vintage Story Server (Docker) A containerized Vintage Story server with simple setup using Docker Compose. --- ## Prerequisites - Docker (v20.10 or higher) - Docker Compose (v2.0 or higher) - A Vintage Story server download link from your account at https://account.vintagestory.at/downloads **Note:** If you are behind CGNAT or don't have a public IP, see [Tunneling Solution](#tunneling-solution-for-cgnat-or-no-public-ip). --- ## Features - **Simple deployment** - Build and run with a single command - **Data persistence** - Server saves and configuration stored in a local `./data` directory - **Interactive mode** - Attach to the running container to send commands directly - **Auto-restart** - Server automatically restarts if it crashes - **Customizable** - Use any Vintage Story server version by changing the download URL --- ## First Time Setup ### Creating your `.env` file The `.env` file stores your server configuration. Copy the example file: ```bash cp .env.example .env ``` Then edit it with your actual server URL: ```bash nano .env # or use your preferred editor ``` **Required format:** ``` VS_SERVER_URL=https://your-download-link-here.tar.gz ``` **Where to get the URL:** 1. Log in at https://account.vintagestory.at/downloads 2. Click "Show all available downloads and mirrors of Vintage Story" 3. Click Find the newest link that says "Linux tar.gz Archive (server only) 4. Right click on the link, then select "Copy link". 5. Copy the full URL into your `.env` file ### Starting your server Once `.env` is configured: ```bash # Build and start in one command docker compose up -d # Check it's running docker compose ps # View logs docker compose logs -f ``` ### Access the Server console ```bash docker compose attach vintagestory ``` Press `Ctrl+P`, then `Ctrl+Q` to detach without stopping. ### Stopping and removing ```bash # Stop the server docker compose stop # Remove the container (data persists in ./data) docker compose down ``` --- ## Configuration ### Volume Mount The `./data` directory on your host machine is mounted to `/data` inside the container. This directory contains: - Server configuration files (`serverconfig.json`, etc.) - World saves - Player data - Logs **To backup your server:** Simply copy the `./data` directory. ### Port Mapping - **Host Port:** 42420 - **Container Port:** 42420 The server is accessible to players on `your-server-ip:42420`. **To change the port:** Edit `docker-compose.yaml` and modify the port mapping: ```yaml ports: - "YOUR_HOST_PORT:42420" ``` ### Server Arguments You can pass additional arguments to the server by modifying the `docker-compose.yaml`: ```yaml services: vintagestory: command: ["--dataPath", "/data", "--port", "42420", "--maxPlayers", "20"] ``` --- ## .NET Version This container uses **.NET 8.0** (base image: `mcr.microsoft.com/dotnet/aspnet:8.0`). Vintage Story server versions require specific .NET versions to run. The current container is configured for server versions that support .NET 8.0. If you want to use an older Vintage Story server version that requires a different .NET version, you'll need to update the base image in the `Dockerfile`. **To change the .NET version:** 1. Open `Dockerfile` 2. Change the first line from `FROM mcr.microsoft.com/dotnet/aspnet:8.0` to your desired version (e.g., `mcr.microsoft.com/dotnet/aspnet:7.0`) 3. Rebuild the container: `docker compose build` --- ## Usage ### Viewing Logs ```bash # View all logs docker compose logs # View logs in real-time docker compose logs -f # View last 100 lines docker compose logs --tail=100 ``` ### Attaching to the Server Console ```bash docker compose attach vintagestory ``` Once attached, you can: - View server logs in real-time - Send commands directly to the server - See player join/leave messages - Monitor server performance **Detaching:** Press `Ctrl+P`, then `Ctrl+Q` (this detaches without stopping the server) ### Restarting the Server ```bash docker compose restart ``` --- ## Common Server Commands All server commands can be found on the [Vintage Story Wiki](https://wiki.vintagestory.at/index.php?title=List_of_server_commands), but here are few helpful ones to get started. ``` /player [playername] whitelist on /op [playername] ``` --- ## Updating the Server ### Updating to a new version **Method 1: Using `.env` (Recommended)** 1. Stop the server: ```bash docker compose stop ``` 2. Update the URL in `.env`: ```bash nano .env # Replace VS_SERVER_URL with new version link ``` 3. Rebuild and restart: ```bash docker compose build docker compose up -d ``` **Method 2: Override at build time (Advanced)** ```bash docker compose build --build-arg VS_SERVER_URL=https://new-url.tar.gz docker compose up -d ``` This is useful for one-time builds without modifying `.env`. --- ## Troubleshooting ### Server won't start **Check logs:** ```bash docker compose logs ``` **Common issues:** - Port 42420 already in use - change the port in `docker-compose.yaml` - Insufficient disk space - ensure you have space for server data - Invalid download URL - verify the URL is accessible ```bash curl -I -f --connect-timeout 10 https://your-download-link.tar.gz ``` Output should be something like `HTTP/2 200` for the first line returned. ### Can't connect to server **Verify server is running:** ```bash docker compose ps ``` **Check port mapping:** ```bash docker compose port vintagestory 42420 ``` **Firewall:** Ensure port 42420 is open on your firewall: ```bash sudo ufw allow 42420/tcp #Or whatever firewall tool you prefer ``` **Ports** If you are using your router's public IP, make sure you've followed the proper [port forwarding](https://en.wikipedia.org/wiki/Port_forwarding) instructions for your specific router. ### Server crashes unexpectedly **Check health status:** ```bash docker inspect --format='{{.State.Health.Status}}' vintagestory-server ``` **View crash logs:** ```bash docker compose logs --tail=200 ``` **Increase restart delay:** Edit `docker-compose.yaml` to add restart delay: ```yaml restart: unless-stopped restart_policy: maximum_retry_count: 3 delay: 10s ``` ### Lost server data **Check if data directory exists:** ```bash ls -la ./data ``` **If data is missing:** - Ensure the volume mount is correct in `docker-compose.yaml` - Restore from backup if available --- ## Advanced Configuration ### Custom Server Configuration Edit `serverconfig.json` in the `./data` directory, then restart the container. ### Running Multiple Servers To run multiple servers on the same machine, create separate directories with different `docker-compose.yaml` files: ``` servers/ ├── server1/ │ ├── docker-compose.yaml │ └── data/ └── server2/ ├── docker-compose.yaml └── data/ ``` Each with different port mappings: ```yaml ports: - "42421:42420" # Server 1 - "42422:42420" # Server 2 ``` ### Environment Variables By default, Docker Compose automatically reads `.env` from the current directory (use the provided `.env.example` as a template). No extra flags needed! If you need to use a custom env file: ```bash docker compose --env-file /path/to/custom.env up -d ``` Or export variables in your shell: ```bash export VS_SERVER_URL=https://your-url.tar.gz docker compose up -d ``` --- ## License Vintage Story Server software is subject to the [Vintage Story Terms of Service](https://www.vintagestory.at/tos.html/). This Docker configuration is licensed under the **GPL v3**. See [LICENSE](LICENSE) for details. ``` This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. ``` --- ## Tunneling Solution (for CGNAT or No Public IP) If you're behind CGNAT (Carrier-Grade NAT) or don't have a public IP address, you won't be able to forward ports on your router. This is common with mobile networks, fiber connections, or some ISP setups. In these cases, you can use **frp** (Fast Reverse Proxy) to create an outbound tunnel to a machine that *does* have a public IP (such as a VPS or friend's place with a public IP). ### What is frp? [frp](https://github.com/fatedier/frp) is a high-performance reverse proxy that enables you to expose a local service to the internet through a tunnel. It consists of two components: - **frps** (server) - Runs on a machine with a public IP - **frpc** (client) - Runs on your private machine running the Vintage Story server ``` ┌─────────────────┐ │ Internet │ └────────┬────────┘ │ │ Players connect here │ public-ip:42420 ▼ ┌─────────────────────────┐ │ Public IP Machine │ │ (runs frps) │ │ Port 7000, 42420 open │ └───────────┬─────────────┘ │ │ frp tunnel (encrypted) │ Port 7000 ▼ ┌─────────────────────────┐ │ Private Machine │ │ (runs frpc + VS Server)│ │ Port 42420 │ └─────────────────────────┘ ``` ### Download frp Download the latest release from the [frp GitHub releases](https://github.com/fatedier/frp/releases). For Linux (amd64): ```bash # Example for v1.2.0 - check releases for latest version wget https://github.com/fatedier/frp/releases/download/v1.2.0/frp_<verion_and_architecture>.tar.gz tar -xzf frp_<version_and_architecture>.tar.gz cd frp_<version_and_architecture> ``` You'll find the `frps` and `frpc` binaries in the extracted folder. ### Configuration Files Two configuration files are provided in this repository: | File | Purpose | Location | |------|---------|----------| | `frps.toml` | Server configuration | Machine with **public IP** | | `frpc.toml` | Client configuration | Machine running **Vintage Story server** | ** Important: Before using, you must edit both files:** 1. **frps.toml** - Replace `INSERT_TOKEN_HERE` with a secure random token 2. **frpc.toml** - Replace `INSERT_TOKEN_HERE` with the **same token**, and change `serverAddr = "PUBLIC_IP"` to your public IP machine's address or domain You can generate a secure token using [randomkeygen.com](https://randomkeygen.com) or similar tools. ### Port Forwarding (If Behind a Router) If your public IP machine is itself behind a router or firewall, you must forward **both** ports: - **7000** - frp control connection - **42420** - Vintage Story game traffic Without forwarding port 42420, players won't be able to connect. ### Quick Start **On Public IP Machine (frps):** ```bash # Edit frps.toml first! ./frps -c frps.toml ``` **On Vintage Story Server Machine (frpc):** ```bash # Edit frpc.toml first! ./frpc -c frpc.toml ``` **For production use**, run with `nohup` or set up as a systemd service: ```bash # Nohup example (runs in background) nohup ./frps -c frps.toml > frps.log 2>&1 & nohup ./frpc -c frpc.toml > frpc.log 2>&1 & ``` ### Systemd Service (Optional) For automatic startup and better management, create systemd services: **On Public IP Machine (/etc/systemd/system/frps.service):** ```ini [Unit] Description=frp Server After=network.target [Service] Type=simple User=root ExecStart=/path/to/frp/frps -c /path/to/frps.toml Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target ``` **On Server Machine (/etc/systemd/system/frpc.service):** ```ini [Unit] Description=frp Client After=network.target [Service] Type=simple User=root ExecStart=/path/to/frp/frpc -c /path/to/frpc.toml Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target ``` Enable and start the services: ```bash sudo systemctl daemon-reload sudo systemctl enable frps # or frpc on client sudo systemctl start frps # or frpc on client ``` ### Connecting Players connect to: **`your-public-ip:42420`** The traffic tunnels through frp to your Vintage Story server on the private machine. --- ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## Support If you encounter any issues or have questions, please open an issue on the repository.
  2. I've made a docker compose setup for the server. All the the instructions are in the README, it works for configurations behind CGNAT as well. https://codeberg.org/Shampan/vintagestory-server-docker
  3. @Empy Using the dotnet command directly on the dll file will run the server.
  4. I am running .NET 7.0
  5. whoami gives me my server-user for all paths but vintage story is nologin according to the wiki so I won't be able to switch to it regardless no? All the vintage story files are owned by vitnagestory, user and group. ls -la for the server folder drwxr-xr-x 5 vintagestory vintagestory 4096 Jan 18 00:20 . drwx------ 13 server-user server-user 4096 Jan 18 00:23 .. drwxr-xr-x 5 vintagestory vintagestory 4096 Oct 27 19:16 assets -rw-r--r-- 1 vintagestory vintagestory 9694 May 17 2024 credits.txt drwxr-xr-x 2 vintagestory vintagestory 4096 Oct 27 19:16 Lib drwxr-xr-x 2 vintagestory vintagestory 4096 Oct 27 19:16 Mods -rwxr-xr-x 1 vintagestory vintagestory 11252 Oct 27 19:50 server.sh -rw-r--r-- 1 vintagestory vintagestory 1844224 May 17 2024 VintagestoryAPI.dll -rw-r--r-- 1 vintagestory vintagestory 676572 May 17 2024 VintagestoryAPI.pdb -rw-r--r-- 1 vintagestory vintagestory 1816463 May 17 2024 VintagestoryAPI.xml -rw-r--r-- 1 vintagestory vintagestory 2609152 May 17 2024 VintagestoryLib.dll -rw-r--r-- 1 vintagestory vintagestory 937192 May 17 2024 VintagestoryLib.pdb -rwxr-xr-x 1 vintagestory vintagestory 181016 May 17 2024 VintagestoryServer -rw-r--r-- 1 vintagestory vintagestory 40018 May 17 2024 VintagestoryServer.deps.json -rw-r--r-- 1 vintagestory vintagestory 94720 May 17 2024 VintagestoryServer.dll -rw-r--r-- 1 vintagestory vintagestory 12780 May 17 2024 VintagestoryServer.pdb -rw-r--r-- 1 vintagestory vintagestory 253 May 17 2024 VintagestoryServer.runtimeconfig.json -rw-r--r-- 1 vintagestory vintagestory 32058681 May 17 2024 vs_server_linux-x64_1.19.8.tar.gz Despite being owned by vintage story trying to run the start command still gives this error: "Warning! Problems with VintagestoryServer.dll! Make sure user vintagestory has read/write access. VintagestoryServer.dll is not running." ls -la for /var/vintage story drwxr-xr-x 3 root root 4096 Oct 27 19:51 . drwxr-xr-x 14 root root 4096 Nov 21 21:54 .. drwxrwxr-x 2 vintagestory vintagestory 4096 Oct 27 19:51 data
  6. Hi I've installed the vintage story server on debian 12 and have followed all of the instructions, however running ./server.sh start gives the following error: Fatal! [USER] failed to adjust data privileges. Aborting. When running it with sudo permissions I get: Starting VintagestoryServer.dll ... bash: line 1: cd: /home/[USER]/server: Permission denied Warning! Problems with VintagestoryServer.dll! Make sure user vintagestory has read/write access. VintagestoryServer.dll is not running. Error! User vintagestory could not start VintagestoryServer.dll! Please check /var/vintagestory/data/Logs. There is nothing at var/vintagestory/data/Logs. I've tried giving user vintagestory owner of all files in ~/server and still nothing will work. I can start the server with dotnet VintagestoryServer.dll, but cannot enter the server console. Any troubleshooting or help would be appreciated. If this is in the wrong place let me know and I will move it.
  7. Ah slight issue I'm unable to OP my character to run that command in game to begin with. ./run_server command isn't working so I'm running straight from the DLL file.
  8. How do I turn on Node Search for pro pick after I've already started the server?
  9. I understand that the it is still currently experimental but I decided to give it a whirl anyway on a pi5. I have .NET 7 installed and all the prerequisites for running the server. I have tried manual installation, the arminstall script, and the docker compose method. All of them result in the same error. Was wondering if anyone had any insight or solutions, thanks. Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'VintagestoryServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Aborted
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.