Skip to content
VpnHood!

Server configuration

Every setting of VpnHood! SERVER, with its default and what it does. The defaults suit most servers, so set only what you need to change.

How a server gets its settings

A setting left out takes its default. A standalone server reads its settings from a file on the server. A managed server takes them from its server profile in VpnHood! MANAGER, whose advanced edit uses the same names as the tables below.

The settings file

A standalone server reads its settings from /opt/VpnHoodServer/storage/appsettings.json. A new install has no such file: create it, and from then on the server uses it whole, in place of the settings it was installed with. Put in only what you change.

In Docker, the file is in the same place on the host. Where you cannot edit a file, the VH_APPSETTINGS environment variable can hold its whole content instead: see Change the settings.

For example: the address for access keys, idle sessions kept longer, and 2 GB of swap

{
  "LogLevel": "Information",
  "FileAccessManager": {
    "PublicEndPoints": [ "203.0.113.10:443" ],
    "Session": {
      "Timeout": "01:30:00"
    }
  },
  "ServerConfig": {
    "Os": { "SwapMemorySizeMb": 2048 }
  }
}

Then restart the server with sudo systemctl restart VpnHoodServer, or with sudo docker restart VpnHoodServer in Docker. A value the server cannot read stops it from starting, and its message names the file.

General settings

These go at the top level of the file, outside any group.

SettingDefaultWhat it does
LogLevel"Information"How much the server writes to its log, /opt/VpnHoodServer/storage/logs/server.log: from Trace, the most, to Error, the least.
AllowAnonymousTrackertrueSends VpnHood anonymous usage figures: the server's version, the app version of each new session, and how many sessions the server holds. Set false to send none.
HttpAccessManagernullConnects the server to VpnHood! MANAGER, which makes it a managed server. The install command that MANAGER shows writes it for you.
FileAccessManagerA standalone server's settings: its access keys, and the groups below.
ServerConfignullThe settings of the groups below. One set here wins over the same one under FileAccessManager, and over a managed server's profile.

Access keys

Under FileAccessManager only: what a standalone server puts in its access keys.

SettingDefaultWhat it does
PublicEndPointsFound by the serverThe addresses and ports that go into access keys. Left out, the server finds its public IP addresses itself and uses the ports it listens on. Use real addresses only: 0.0.0.0 or [::] here stops the server from starting. See Set your server's IP addresses.
IsValidHostNamefalseSet it to true when the server's certificate is a trusted one for your domain: apps then check it as a web browser does. Otherwise, access keys carry the certificate's fingerprint. See Use a domain name and a trusted certificate.
HostPortThe first public portThe port that access keys give with your domain.
SslCertificatesPasswordnullThe password of the server's certificate file, /opt/VpnHoodServer/storage/access/certificates/default.pfx, if it has one.
ServerTokenUrls[]Addresses where apps read the server's updated details, so access keys keep working after its addresses change. See Server token URLs.
ReplyAccessKeytrueGives an app the access key's latest details each time it connects. Set false to update keys through the URLs above alone.
UseExternalLocationServicetrueAsks online services once for the server's location, which access keys carry, and keeps it in /opt/VpnHoodServer/storage/access/server_location. Set false to ask none.

Server-wide settings

Under FileAccessManager or ServerConfig, as are all the groups below.

SettingDefaultWhat it does
TcpEndPoints["0.0.0.0:443",
"[::]:443"]
The addresses and ports the server listens on.
UdpEndPointsTCP's addresses, on a port of the server's choosingWhere the server takes the apps' UDP. Left out, a standalone server listens on the addresses of TCP, on a port it picks at its first start and keeps in /opt/VpnHoodServer/storage/access/udp_port; port 0 picks it too. Open that port for UDP in the firewalls. [] turns UDP off. Use the same addresses as TCP.
QuicEndPointsNoneWhere the server takes the apps' QUIC, where the system supports it. Port 0 takes a free port. Use the same addresses as TCP.
DnsServersGoogle'sThe DNS servers the server gives the apps, as IP addresses without a port. The network filter lets them through, but one at an address that is not public needs IncludeLocalNetwork.
LogAnonymizertrueHides IP addresses and IDs in the server's log. What the tracking settings record stays as it is.
ReverseProxyProviders["Cloudflare"]The reverse proxies the server trusts to tell it each user's IP address. See Put your server behind a reverse proxy.
ReverseProxyIpRanges[]More addresses the server trusts to tell it each user's IP address, such as your own reverse proxy's.
MinCompletionPortThreads30 times .NET'sThe fewest threads the server keeps ready for network work, for a busy server. 0 leaves .NET's own.
MaxCompletionPortThreads65535The most threads for network work, so that a busy server slows down evenly rather than making requests wait in a queue. 0 leaves .NET's own.

Tracking

What the track log, /opt/VpnHoodServer/storage/logs/track.log, records of your users' connections. It is off while the first four settings are off, as they are by default. It records the connections the server opens itself, not the traffic it passes through its VPN adapter.

SettingDefaultWhat it does
TrackClientIpfalseRecords each user's IP address as it is, in the track log and in the session log, /opt/VpnHoodServer/storage/logs/sessions.log.
TrackLocalPortfalseRecords the port the server opens for each connection.
TrackDestinationIpfalseRecords where each connection goes, as a code that tells addresses apart without showing them.
TrackDestinationPortfalseRecords the port each connection goes to.
TrackTcptrueRecords TCP connections.
TrackUdptrueRecords UDP.
TrackIcmptrueRecords ICMP, such as ping.

Sessions

Each app that connects holds a session. Times are hours, minutes and seconds, such as 01:30:00 for an hour and a half.

Timeouts

SettingDefaultWhat it does
Timeout"00:30:00"How long a session may go without activity before the server closes it.
TcpIdleTimeout"01:00:00"How long a TCP connection the server forwards may pass nothing either way before the server closes it, such as one whose destination never answers, or whose phone changed networks. The server checks about every 30 seconds. A shorter time can cut a phone's push notifications, whose connection may stay quiet for nearly half an hour.
UdpTimeout"00:01:00"How long the server keeps an idle UDP port open for a session, where it forwards UDP itself rather than through its VPN adapter.
IcmpTimeout"00:00:30"How long the server remembers a destination a session pings, where it forwards ICMP itself.
TcpConnectTimeout"00:00:30"How long a request on an app's new connection may take, the server's connection to the destination included.
ChannelIdleTimeout"00:00:40"How long the server keeps an app's idle connection open for its next request.

Limits

SettingDefaultWhat it does
MaxPacketChannelCount8The most packet tunnels, over TCP or QUIC, an app may keep open at once. The server tells the apps, so they open no more. UDP's single tunnel does not count.
MaxTcpChannelCount1000The most TCP connections a session may have at once, its tunnels and connections under way included. Above it, the server refuses a new one.
MaxTcpConnectWaitCount500The most TCP connections a session may have under way at once, not yet answered by their destination.
MaxTcpConnectsPerSecond200The most new TCP connections a session may make a second: far above a browser's bursts, far below a flood.
MaxUdpClientCount500The most UDP ports a session may hold, where the server forwards UDP itself. DNS has its own limit.
MaxUdpDnsPacketsPerSecond200The most DNS packets over UDP a session may send a second: far above a device's own lookups, far below a flood that would get the server reported.
MaxIcmpClientCount20The most ICMP flows, such as pings, a session may have at once, where the server forwards ICMP itself.
MaxUnauthenticatedConnectionCount1000For the whole server: the most connections that have not shown a valid access key yet, port 80's included. Above it, the address that holds the most loses its oldest.
NetScanLimitNoneThe most addresses of one IPv4 /24 network a session may reach within NetScanTimeout, to stop a user scanning networks. Unset, there is no limit.
NetScanTimeoutNoneHow long an address counts toward NetScanLimit.

How traffic travels

SettingDefaultWhat it does
AllowTcpForwardingtrueLets TCP travel by forwarding: the app ends each connection on the device, and the server opens a new one to the destination. The server does not accept this and AllowTcpPacket both turned off, which would leave TCP no way through. A server without a VPN adapter, as in Docker, does not accept this one turned off.
AllowTcpPackettrueLets TCP travel as packets in the tunnel, end to end. Settings for a censored network says when to turn it off.
AllowUdpPackettrueLets your users' own UDP through, DNS aside. The server enforces it only with AllowTcpPacket off.
AllowQuicPackettrueLets your users' own QUIC through. The server enforces it only with AllowTcpPacket off.
MinClientProtocolVersionThe server's own minimumThe oldest app protocol the server accepts; a lower value cannot lower the server's own minimum. Turn away probes says when to set 15.

Buffers

Leave them out unless you have measured a reason: each buffer takes memory for every connection. Each is a pair of sizes in bytes, such as { "Send": 16384, "Receive": 16384 }.

SettingDefaultWhat it does
TcpKernelBufferSizeThe system'sThe system's buffers for the server's TCP connections.
StreamForwardingBufferSizeAbout 8 KB each wayThe buffers of each TCP connection the server forwards. A busy server forwards many at once, so a larger size costs memory fast.
UdpForwardingBufferSizeThe system'sThe system's buffers for the UDP the server forwards itself.
UdpChannelBufferSizeThe system'sThe system's buffers for the apps' UDP tunnel.

Traffic reports

SettingDefaultWhat it does
SyncInterval"00:20:00"The longest a session's traffic goes unreported to the server's access manager, which counts it against the access key's limits.
SyncCacheSize100000000The unreported traffic, in bytes, at which a session's traffic is reported at once.

Network filter

Which destinations your users can reach through the server. An address range is written as 198.51.100.0/24 or 198.51.100.10-198.51.100.20, and a port range as "6881-6889".

SettingDefaultWhat it does
NetworkIsolationtrueKeeps your users from reaching each other's devices through the server.
IncludeLocalNetworkfalseLets your users reach the server's own addresses and every network that is not public: its loopback, its local network and its provider's internal network. Set it only where users should reach the server's network: a service that listens on the loopback for the machine alone becomes theirs to reach too.
IncludeIpRangesAllThe only destinations the server routes. It tells the apps.
ExcludeIpRangesNoneDestinations the server does not route.
VpnAdapterIncludeIpRangesAllThe only destinations the apps' VPN adapters capture on the device; the rest goes outside the VPN.
VpnAdapterExcludeIpRangesNoneDestinations the apps' VPN adapters leave outside the VPN.
BlockIpV6falseBlocks IPv6 and tells the apps the server carries none.
BlockTcpPorts["25"]TCP ports your users cannot reach. A list you set replaces the default, port 25, which keeps mail sent through the server from getting its IP address listed as a spam source.
BlockUdpPorts[]UDP ports your users cannot reach.

Operating system

What the server sets on the machine's operating system: on Linux only, and only where the system lets it, which a container may not. Without root, it changes none. It changes the running system alone, so restarting the machine puts back the system's own values.

SettingDefaultWhat it does
TcpCongestionControl"bbr"The TCP congestion control the server sets. "*" puts back the system's own.
ConnectionTrackingMax1048576The most connections the system tracks at once. The server's NAT needs this tracking, and a full list makes the system drop new connections, your users' and the server's own. The server never lowers the system's own value. 0 puts it back.
ConnectionTrackingTcpIdleTimeout"01:00:00"How long the system keeps tracking a TCP connection that sends nothing. Many of a VPN's connections end without a close, as when a phone changes networks, and Linux's own 5 days fill the list. 00:00:00 puts back the system's own.
SwapMemorySizeMbnullThe swap the server wants in all, in megabytes: its own swap file makes up what the system's other swap lacks. Left out, or 0, the server removes its own swap file.
AddListenerIpsToNetworknullThe network interface the server adds its listening addresses to, where the system does not have them yet, such as an extra IP address from your hosting provider. Left out, or "*", it takes the first interface.

Older names

Older settings files may hold these names. The server still reads them, except TcpTimeout, which it ignores: to keep a time you set there, set it as TcpIdleTimeout.

Older nameName now
Session.TcpTimeoutSession.TcpIdleTimeout
Session.StreamProxyBufferSizeSession.StreamForwardingBufferSize
Session.UdpProxyBufferSizeSession.UdpForwardingBufferSize
Session.AllowTcpProxySession.AllowTcpForwarding
TcpCongestionControlOs.TcpCongestionControl
SwapMemorySizeMbOs.SwapMemorySizeMb
AddListenerIpsToNetworkOs.AddListenerIpsToNetwork
ServerTokenUrlServerTokenUrls
FileAccessServerFileAccessManager
HttpAccessServer, RestAccessServerHttpAccessManager