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:
- Open
serverconfig.json - Find the Port setting:
{
"Port": 42420
}
- Change to your desired port number
- Save and restart the server
- Update firewall and router rules accordingly
Firewall Configuration
Windows Firewall
- Open Windows Defender Firewall with Advanced Security
- Click "Inbound Rules" in the left panel
- Click "New Rule" in the right panel
- Select "Port" and click Next
- Select "TCP" and enter port 42420
- Select "Allow the connection"
- Apply to all profiles (Domain, Private, Public)
- Name the rule "Vintage Story Server TCP"
- 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
- Access your router admin panel (usually 192.168.1.1 or 192.168.0.1)
- Find "Port Forwarding" or "Virtual Server" section
- 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)
- Save and apply the configuration
- Restart router if required
Testing Port Accessibility
Internal Testing
- Start your Vintage Story server
- On the same network, try connecting with:
localhost:42420
or your local IP:
192.168.1.x:42420
External Testing
- Find your public IP at whatismyipaddress.com
- Use an online port checker tool
- Test with both TCP and UDP protocols
- 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:42420if on same machine
Multiple Servers on Same Machine
To run multiple Vintage Story servers:
- Configure each server with a different port:
Server 1: Port 42420
Server 2: Port 42421
Server 3: Port 42422
- Forward each port separately in your router
- Create separate firewall rules for each port
- Use different data directories for each server
Dynamic DNS Setup
If your ISP provides a dynamic IP address:
- Sign up for a free Dynamic DNS service (e.g., No-IP, DuckDNS)
- Create a hostname (e.g., myserver.ddns.net)
- Install the DDNS client on your server
- Configure it to update your IP automatically
- 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