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.
| Setting | Default | What 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.
|
AllowAnonymous | true | Sends 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.
|
HttpAccess | null | Connects the server to VpnHood! MANAGER, which makes it a managed server. The install command that MANAGER shows writes it for you. |
FileAccess | A standalone server's settings: its access keys, and the groups below. | |
ServerConfig | null | The 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.
| Setting | Default | What it does |
|---|---|---|
PublicEndPoints | Found by the server | The 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.
|
IsValidHostName | false | Set 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.
|
HostPort | The first public port | The port that access keys give with your domain. |
SslCertificates | null | The 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. |
ReplyAccessKey | true | Gives an app the access key's latest details each time it connects. Set false to update keys through the URLs above alone.
|
UseExternal | true | Asks 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.
| Setting | Default | What it does |
|---|---|---|
TcpEndPoints | ["0.0.0.0:443","[::]:443"] | The addresses and ports the server listens on. |
UdpEndPoints | TCP's addresses, on a port of the server's choosing | Where 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.
|
QuicEndPoints | None | Where the server takes the apps' QUIC, where the system supports it. Port 0 takes a free port. Use the same addresses as TCP. |
DnsServers | Google's | The 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.
|
LogAnonymizer | true | Hides IP addresses and IDs in the server's log. What the tracking settings record stays as it is. |
ReverseProxy | ["Cloudflare"] | The reverse proxies the server trusts to tell it each user's IP address. See Put your server behind a reverse proxy. |
ReverseProxy | [] | More addresses the server trusts to tell it each user's IP address, such as your own reverse proxy's. |
MinCompletion | 30 times .NET's | The fewest threads the server keeps ready for network work, for a busy server. 0 leaves .NET's own.
|
MaxCompletion | 65535 | The 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.
| Setting | Default | What it does |
|---|---|---|
TrackClientIp | false | Records each user's IP address as it is, in the track log and in the session log, /opt/VpnHoodServer/storage/logs/sessions.log.
|
TrackLocalPort | false | Records the port the server opens for each connection. |
TrackDestinationIp | false | Records where each connection goes, as a code that tells addresses apart without showing them. |
TrackDestination | false | Records the port each connection goes to. |
TrackTcp | true | Records TCP connections. |
TrackUdp | true | Records UDP. |
TrackIcmp | true | Records 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
| Setting | Default | What 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
| Setting | Default | What it does |
|---|---|---|
MaxPacketChannel | 8 | The 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. |
MaxTcpChannel | 1000 | The most TCP connections a session may have at once, its tunnels and connections under way included. Above it, the server refuses a new one. |
MaxTcpConnect | 500 | The most TCP connections a session may have under way at once, not yet answered by their destination. |
MaxTcpConnects | 200 | The most new TCP connections a session may make a second: far above a browser's bursts, far below a flood. |
MaxUdpClient | 500 | The most UDP ports a session may hold, where the server forwards UDP itself. DNS has its own limit. |
MaxUdpDns | 200 | The 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. |
MaxIcmpClient | 20 | The most ICMP flows, such as pings, a session may have at once, where the server forwards ICMP itself. |
MaxUnauthenticated | 1000 | For 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. |
NetScanLimit | None | The most addresses of one IPv4 /24 network a session may reach within NetScanTimeout, to stop a user scanning networks. Unset, there is no limit.
|
NetScanTimeout | None | How long an address counts toward NetScanLimit.
|
How traffic travels
| Setting | Default | What it does |
|---|---|---|
AllowTcp | true | Lets 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.
|
AllowTcpPacket | true | Lets TCP travel as packets in the tunnel, end to end. Settings for a censored network says when to turn it off. |
AllowUdpPacket | true | Lets your users' own UDP through, DNS aside. The server enforces it only with AllowTcpPacket off.
|
AllowQuicPacket | true | Lets your users' own QUIC through. The server enforces it only with AllowTcpPacket off.
|
MinClientProtocol | The server's own minimum | The 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 }.
| Setting | Default | What it does |
|---|---|---|
TcpKernelBuffer | The system's | The system's buffers for the server's TCP connections. |
StreamForwarding | About 8 KB each way | The buffers of each TCP connection the server forwards. A busy server forwards many at once, so a larger size costs memory fast. |
UdpForwarding | The system's | The system's buffers for the UDP the server forwards itself. |
UdpChannel | The system's | The system's buffers for the apps' UDP tunnel. |
Traffic reports
| Setting | Default | What 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. |
SyncCacheSize | 100000000 | The 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".
| Setting | Default | What it does |
|---|---|---|
NetworkIsolation | true | Keeps your users from reaching each other's devices through the server. |
IncludeLocal | false | Lets 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. |
IncludeIpRanges | All | The only destinations the server routes. It tells the apps. |
ExcludeIpRanges | None | Destinations the server does not route. |
VpnAdapterInclude | All | The only destinations the apps' VPN adapters capture on the device; the rest goes outside the VPN. |
VpnAdapterExclude | None | Destinations the apps' VPN adapters leave outside the VPN. |
BlockIpV6 | false | Blocks 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.
| Setting | Default | What it does |
|---|---|---|
TcpCongestion | "bbr" | The TCP congestion control the server sets. "*" puts back the system's own.
|
Connection | 1048576 | The 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.
|
Connection | "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.
|
SwapMemory | null | The 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.
|
AddListenerIps | null | The 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 name | Name now |
|---|---|
Session.TcpTimeout | Session.TcpIdleTimeout |
Session.StreamProxyBufferSize | Session.StreamForwardingBufferSize |
Session.UdpProxyBufferSize | Session.UdpForwardingBufferSize |
Session.AllowTcpProxy | Session.AllowTcpForwarding |
TcpCongestionControl | Os.TcpCongestionControl |
SwapMemorySizeMb | Os.SwapMemorySizeMb |
AddListenerIpsToNetwork | Os.AddListenerIpsToNetwork |
ServerTokenUrl | ServerTokenUrls |
FileAccessServer | FileAccessManager |
HttpAccessServer, RestAccessServer | HttpAccessManager |