<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fhetzner</id>
	<title>Unity.Multiplayer/articles/hosting/hetzner - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fhetzner"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/hetzner&amp;action=history"/>
	<updated>2026-12-05T12:58:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/hetzner&amp;diff=922&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/hetzner&amp;diff=922&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:57Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Hosting on Hetzner Cloud (Hetzner) =&lt;br /&gt;
&lt;br /&gt;
A UM-T26 plain-VPS cloud profile: &amp;lt;code&amp;gt;mp-host&amp;lt;/code&amp;gt; creates the server itself through Hetzner&amp;#039;s REST API (&amp;lt;code&amp;gt;https&amp;amp;#58;//api.hetzner.cloud/v1&amp;lt;/code&amp;gt;) from an Ubuntu image, with cloud-init bootstrapping the container plus rendezvous on first boot -- unlike GenericVps, there&amp;#039;s no box to rent by hand first.&lt;br /&gt;
&lt;br /&gt;
== What &amp;lt;code&amp;gt;mp-host deploy&amp;lt;/code&amp;gt; does here ==&lt;br /&gt;
&lt;br /&gt;
# Builds (or reads an already-built) server package and its Docker image, then pushes the image to GHCR.&lt;br /&gt;
# Registers your SSH public key with Hetzner (&amp;lt;code&amp;gt;POST /ssh_keys&amp;lt;/code&amp;gt;, reusing an already-registered key of the same name) and creates a server (&amp;lt;code&amp;gt;POST /servers&amp;lt;/code&amp;gt;) from the &amp;lt;code&amp;gt;ubuntu-24.04&amp;lt;/code&amp;gt; image with a &amp;lt;code&amp;gt;#cloud-config&amp;lt;/code&amp;gt; user-data document: the same &amp;lt;code&amp;gt;docker-compose.yml&amp;lt;/code&amp;gt; and bootstrap script &amp;lt;code&amp;gt;GenericVpsProvisioner&amp;lt;/code&amp;gt; uploads over SSH, but run automatically by cloud-init on first boot.&lt;br /&gt;
# Creates a Hetzner Cloud Firewall with one rule per declared port (your game port, at its own protocol) plus the rendezvous service&amp;#039;s TCP port, and applies it to the new server -- a hard requirement here, since mp-host created the server&amp;#039;s firewall itself, unlike a bring-your-own GenericVps box.&lt;br /&gt;
# Polls the server until it has a public IPv4 address, then probes &amp;lt;code&amp;gt;GET http&amp;amp;#58;//127.0.0.1:&amp;amp;lt;healthPort&amp;gt;/healthz&amp;lt;/code&amp;gt; over SSH, the same way GenericVps does.&lt;br /&gt;
# Watches &amp;lt;code&amp;gt;docker compose logs game&amp;lt;/code&amp;gt; over SSH for the self-registration line (&amp;lt;code&amp;gt;[MindAttic.Multiplayer] Join code: ABC-DEF-GHJ&amp;lt;/code&amp;gt;) and prints it.&lt;br /&gt;
&lt;br /&gt;
== Before you deploy ==&lt;br /&gt;
&lt;br /&gt;
Create a Hetzner API token (Project &amp;gt; Security &amp;gt; API Tokens, Read &amp;amp; Write) and generate a disposable SSH keypair for mp-host to register with Hetzner and use for status/logs/update calls. Store both, plus your GHCR token, in the vault -- never in the repo, never on a shared command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host credentials set-hetzner --token &amp;amp;lt;hcloud API token&amp;gt; \&lt;br /&gt;
  --ssh-user root --ssh-key C:\Users\me\.ssh\mp-host-hetzner --ssh-public-key C:\Users\me\.ssh\mp-host-hetzner.pub&lt;br /&gt;
mp-host credentials set-ghcr --username &amp;amp;lt;github-username&amp;gt; --token &amp;amp;lt;PAT with write:packages&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then deploy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host deploy --profile Hetzner --name prod-hetzner --package ./build/GenericVps \&lt;br /&gt;
  --image myorg/mygame --tag v1 \&lt;br /&gt;
  --rendezvous-url http&amp;amp;#58;//&amp;amp;lt;assigned-ip&amp;gt;:8080 \&lt;br /&gt;
  --public-address &amp;amp;lt;assigned-ip&amp;gt; --region nbg1 --size cpx11&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--public-address&amp;lt;/code&amp;gt; has to be filled in after the first deploy prints the assigned IP (or scripted around it); &amp;lt;code&amp;gt;--region&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;--size&amp;lt;/code&amp;gt; default to Nuremberg/CPX11 when omitted. Add &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; first to see every Hetzner API call mp-host would make, without creating anything or spending money.&lt;br /&gt;
&lt;br /&gt;
== Open ports ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Port&lt;br /&gt;
! Protocol&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| your game port&lt;br /&gt;
| UDP (or TCP for WebSocket)&lt;br /&gt;
| Players connect here; opened in the Hetzner Cloud Firewall mp-host creates.&lt;br /&gt;
|-&lt;br /&gt;
| 8080&lt;br /&gt;
| TCP&lt;br /&gt;
| The rendezvous service: players resolve join codes here; also opened in that firewall.&lt;br /&gt;
|-&lt;br /&gt;
| health port&lt;br /&gt;
| TCP, bound to 127.0.0.1&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz&amp;lt;/code&amp;gt;; not reachable from the internet, and not part of the firewall rule set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Updating and tearing down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mp-host update --profile Hetzner --name prod-hetzner --server-id &amp;amp;lt;id&amp;gt; --image myorg/mygame --tag v2 ...&amp;lt;/code&amp;gt; resolves the server&amp;#039;s current IP from Hetzner&amp;#039;s API, then re-renders the compose file and runs &amp;lt;code&amp;gt;docker compose up -d&amp;lt;/code&amp;gt; over SSH in place -- an in-place rolling restart, the same mechanism GenericVps uses once a box exists. &amp;lt;code&amp;gt;mp-host destroy ... --yes&amp;lt;/code&amp;gt; deletes the server outright (&amp;lt;code&amp;gt;DELETE /servers/{id}&amp;lt;/code&amp;gt;) -- unlike GenericVps, there&amp;#039;s no box left over to keep or cancel.&lt;br /&gt;
&lt;br /&gt;
== Cost and sizing notes ==&lt;br /&gt;
&lt;br /&gt;
CPX11 (2 shared vCPUs, 2 GB RAM) is Hetzner&amp;#039;s cheapest shared-vCPU plan and plenty for a small-lobby real-time game server; CX22 is the next step up if your game needs more headroom. Nuremberg (&amp;lt;code&amp;gt;nbg1&amp;lt;/code&amp;gt;) and Falkenstein (&amp;lt;code&amp;gt;fsn1&amp;lt;/code&amp;gt;) are Hetzner&amp;#039;s cheapest EU regions; pick whichever region is closest to your players, and note Hetzner also has a US location (Ashburn, &amp;lt;code&amp;gt;ash&amp;lt;/code&amp;gt;) at a similar price point. Hetzner&amp;#039;s traffic allowance is generous (20 TB/month included on most plans at the time this was written) -- verify current pricing, plan names and included traffic against Hetzner&amp;#039;s live console before committing, since Hetzner has renamed and repriced plans before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/hosting/hetzner.md Unity.Multiplayer/docs/articles/hosting/hetzner.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>