Menu
 

Port Configuration - Vintage Story Wiki

Port Configuration

Proper port configuration is essential for players to connect to your Vintage Story server. This guide covers port settings, firewall configuration, and troubleshooting connectivity issues.

Port Requirements

Vintage Story server requires the following port configuration:

  • Default Port: 42420
  • Protocol: TCP and UDP (version 1.20+)
  • Protocol: TCP only (versions before 1.20)

Changing the Default Port

To use a different port:

  1. Open serverconfig.json

  2. Find the Port setting:

{
  "Port": 42420
}
  1. Change to your desired port number

  2. Save and restart the server

  3. Update firewall and router rules accordingly

Firewall Configuration

Windows Firewall

  1. Open Windows Defender Firewall with Advanced Security

  2. Click "Inbound Rules" in the left panel

  3. Click "New Rule" in the right panel

  4. Select "Port" and click Next

  5. Select "TCP" and enter port 42420

  6. Select "Allow the connection"

  7. Apply to all profiles (Domain, Private, Public)

  8. Name the rule "Vintage Story Server TCP"

  9. Repeat steps 3-8 for UDP protocol

Linux Firewall (UFW)

For Ubuntu/Debian systems:

sudo ufw allow 42420/tcp
sudo ufw allow 42420/udp
sudo ufw reload
sudo ufw status

Linux Firewall (firewalld)

For CentOS/RHEL systems:

sudo firewall-cmd --permanent --add-port=42420/tcp
sudo firewall-cmd --permanent --add-port=42420/udp
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

Router Port Forwarding

If hosting from behind a router, configure port forwarding:

Finding Your Local IP

Windows:

ipconfig

Look for "IPv4 Address" under your active connection

Linux/Mac:

ifconfig

Look for "inet" address under your active interface

Configuring Port Forwarding

  1. Access your router admin panel (usually 192.168.1.1 or 192.168.0.1)

  2. Find "Port Forwarding" or "Virtual Server" section

  3. Create a new port forwarding rule:

  • Service Name: Vintage Story Server
  • External Port: 42420
  • Internal Port: 42420
  • Internal IP: Your server's local IP address
  • Protocol: TCP and UDP (or Both)
  1. Save and apply the configuration

  2. Restart router if required

Testing Port Accessibility

Internal Testing

  1. Start your Vintage Story server

  2. On the same network, try connecting with:

localhost:42420

or your local IP:

192.168.1.x:42420

External Testing

  1. Find your public IP at whatismyipaddress.com

  2. Use an online port checker tool

  3. Test with both TCP and UDP protocols

  4. Have a friend try connecting from outside your network

Troubleshooting Connection Issues

Server Not Visible in Browser

If your server doesn't appear in the server list:

  • Verify port forwarding is configured correctly
  • Check firewall allows both TCP and UDP
  • Ensure server is actually running
  • Try direct connect with IP:Port instead
  • Check if your ISP blocks incoming connections

Connection Timeout

If connections time out:

  • Confirm both TCP and UDP ports are open
  • Verify router port forwarding settings
  • Check if server is overloaded (high CPU/RAM)
  • Try temporarily disabling firewall to test
  • Ensure no VPN is interfering

Players on Same Network Can't Connect

For local network connections:

  • Use local IP address (192.168.x.x) not public IP
  • Verify local firewall allows connections
  • Check if server is bound to correct network interface
  • Try using localhost:42420 if on same machine

Multiple Servers on Same Machine

To run multiple Vintage Story servers:

  1. Configure each server with a different port:

Server 1: Port 42420
Server 2: Port 42421
Server 3: Port 42422
  1. Forward each port separately in your router

  2. Create separate firewall rules for each port

  3. Use different data directories for each server

Dynamic DNS Setup

If your ISP provides a dynamic IP address:

  1. Sign up for a free Dynamic DNS service (e.g., No-IP, DuckDNS)

  2. Create a hostname (e.g., myserver.ddns.net)

  3. Install the DDNS client on your server

  4. Configure it to update your IP automatically

  5. Share the hostname instead of IP address

Security Considerations

  • Password Protection: Set a server password for public servers
  • Whitelist: Consider using a whitelist for private servers
  • Regular Updates: Keep server software updated
  • Monitor Logs: Watch for suspicious connection attempts
  • Limit Exposure: Only forward necessary ports

Version-Specific Changes

Version 1.20 and Later

Starting with version 1.20, Vintage Story requires both TCP and UDP:

  • Update firewall rules to include UDP
  • Add UDP port forwarding in router
  • Test both protocols after upgrade

Pre-1.20 Versions

Older versions only needed TCP:

  • TCP port 42420 is sufficient
  • UDP configuration optional
Top