<?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%2Fflyio</id>
	<title>Unity.Multiplayer/articles/hosting/flyio - 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%2Fflyio"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/flyio&amp;action=history"/>
	<updated>2026-12-05T12:55:21Z</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/flyio&amp;diff=917&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/flyio&amp;diff=917&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:50Z</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 Fly.io (Fly) =&lt;br /&gt;
&lt;br /&gt;
A UM-T28 profile: &amp;lt;code&amp;gt;mp-host&amp;lt;/code&amp;gt; creates the app and its machine straight through Fly&amp;#039;s Machines API (&amp;lt;code&amp;gt;https&amp;amp;#58;//api.machines.dev/v1&amp;lt;/code&amp;gt;) -- no &amp;lt;code&amp;gt;flyctl deploy&amp;lt;/code&amp;gt;, no &amp;lt;code&amp;gt;fly.toml&amp;lt;/code&amp;gt; required at deploy time, though &amp;lt;code&amp;gt;FlyTomlGenerator&amp;lt;/code&amp;gt; can still render one if you want a file to hand &amp;lt;code&amp;gt;flyctl&amp;lt;/code&amp;gt;/Fly&amp;#039;s dashboard later. Fly&amp;#039;s own edge only delivers UDP packets to a machine that binds the special hostname &amp;lt;code&amp;gt;fly-global-services&amp;lt;/code&amp;gt; (never &amp;lt;code&amp;gt;0.0.0.0&amp;lt;/code&amp;gt;), and its free shared (anycast) IPv4 only proxies HTTP(S)/TCP -- a UDP game port needs a dedicated IPv4, which this profile allocates for you.&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;
# Creates the Fly app (&amp;lt;code&amp;gt;POST /apps&amp;lt;/code&amp;gt;, idempotent -- an app that already exists is left alone) under your org.&lt;br /&gt;
# Allocates a dedicated IPv4 for the app (&amp;lt;code&amp;gt;POST /apps/{app}/ips {&amp;quot;type&amp;quot;:&amp;quot;v4&amp;quot;}&amp;lt;/code&amp;gt;).&lt;br /&gt;
# Creates the game machine (&amp;lt;code&amp;gt;POST /apps/{app}/machines&amp;lt;/code&amp;gt;) from the pushed image, with your declared game port in its &amp;lt;code&amp;gt;services&amp;lt;/code&amp;gt; (protocol taken straight from the manifest -- &amp;lt;code&amp;gt;udp&amp;lt;/code&amp;gt; for the default dedicated-server profile) and &amp;lt;code&amp;gt;MINDATTIC_BIND_HOST=fly-global-services&amp;lt;/code&amp;gt; set automatically so the server binds the address Fly&amp;#039;s edge actually delivers UDP to.&lt;br /&gt;
# Creates the rendezvous machine, either as a second machine in the &amp;lt;em&amp;gt;same&amp;lt;/em&amp;gt; app under the &amp;lt;code&amp;gt;rendezvous&amp;lt;/code&amp;gt; process group (default), or as a wholly separate &amp;lt;code&amp;gt;&amp;amp;lt;name&amp;gt;-rendezvous&amp;lt;/code&amp;gt; app -- see &amp;quot;Rendezvous: process group or separate app&amp;quot; below.&lt;br /&gt;
# Polls the game machine until Fly reports it &amp;lt;code&amp;gt;started&amp;lt;/code&amp;gt;. mp-host runs outside Fly&amp;#039;s private network (6PN), so this is &amp;quot;did the machine come up&amp;quot;, not a curl against your health endpoint; a declared health port still gets a &amp;lt;code&amp;gt;tcp_checks&amp;lt;/code&amp;gt; entry in the generated &amp;lt;code&amp;gt;fly.toml&amp;lt;/code&amp;gt; for Fly&amp;#039;s own health tracking.&lt;br /&gt;
# Watches its logs (via &amp;lt;code&amp;gt;flyctl logs&amp;lt;/code&amp;gt;, the one call in this profile that isn&amp;#039;t the Machines API -- see below) 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;
== Why &amp;lt;code&amp;gt;flyctl&amp;lt;/code&amp;gt; shows up at all ==&lt;br /&gt;
&lt;br /&gt;
Every other call in this profile -- create, status, update, destroy -- goes straight to the Machines API over plain REST, mocked directly in NUnit like every other provider. Fly has no simple REST endpoint for application logs (it ships them over its own NATS-based log stream); &amp;lt;code&amp;gt;flyctl logs&amp;lt;/code&amp;gt; is the one place this profile shells out to the &amp;lt;code&amp;gt;flyctl&amp;lt;/code&amp;gt; CLI instead. Install and authenticate it (&amp;lt;code&amp;gt;flyctl auth token&amp;lt;/code&amp;gt;) on whatever machine runs &amp;lt;code&amp;gt;mp-host logs&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;mp-host deploy&amp;lt;/code&amp;gt; if you want to see the join code print automatically; &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; prints the command it would have run instead.&lt;br /&gt;
&lt;br /&gt;
== Before you deploy ==&lt;br /&gt;
&lt;br /&gt;
Create a Fly API token (&amp;lt;code&amp;gt;flyctl tokens create deploy&amp;lt;/code&amp;gt; or the dashboard) and note your org&amp;#039;s slug (&amp;lt;code&amp;gt;personal&amp;lt;/code&amp;gt; for a personal account). 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-fly --token &amp;amp;lt;Fly API token&amp;gt; --org personal&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 Fly --name my-game-server --package ./build/GenericVps \&lt;br /&gt;
  --image myorg/mygame --tag v1 \&lt;br /&gt;
  --rendezvous-url http&amp;amp;#58;//my-game-server.fly.dev:8080 \&lt;br /&gt;
  --public-address &amp;amp;lt;printed dedicated IPv4&amp;gt; --region iad --size shared-cpu-1x&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 allocated dedicated IPv4 (or scripted around it, the same two-step dance as any provider that assigns its address at create time). &amp;lt;code&amp;gt;--region&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;--size&amp;lt;/code&amp;gt; default to &amp;lt;code&amp;gt;iad&amp;lt;/code&amp;gt; (Ashburn, Virginia)/&amp;lt;code&amp;gt;shared-cpu-1x&amp;lt;/code&amp;gt; when omitted; known sizes are &amp;lt;code&amp;gt;shared-cpu-1x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;2x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;4x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;8x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;performance-1x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;2x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;4x&amp;lt;/code&amp;gt;. Fly app names must be globally unique and DNS-safe (lowercase letters, digits, hyphens) -- &amp;lt;code&amp;gt;--name&amp;lt;/code&amp;gt; becomes the app name verbatim. Add &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; first to see every Machines API call mp-host would make, without creating anything or spending money.&lt;br /&gt;
&lt;br /&gt;
== Rendezvous: process group or separate app ==&lt;br /&gt;
&lt;br /&gt;
Pick with the &amp;lt;code&amp;gt;rendezvousMode&amp;lt;/code&amp;gt; launch option (&amp;lt;code&amp;gt;mp-host credentials set-cloud-options --profile Fly --name my-game-server --opt rendezvousMode=app&amp;lt;/code&amp;gt;, alongside any &amp;lt;code&amp;gt;--opt rendezvousImage=...&amp;lt;/code&amp;gt; override -- the default is &amp;lt;code&amp;gt;ghcr.io/mindattic/rendezvous:latest&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;&amp;lt;code&amp;gt;process-group&amp;lt;/code&amp;gt;&amp;lt;/strong&amp;gt; (default): a second machine in the &amp;lt;em&amp;gt;same&amp;lt;/em&amp;gt; Fly app, tagged with the &amp;lt;code&amp;gt;rendezvous&amp;lt;/code&amp;gt; process group (visible as its own group in &amp;lt;code&amp;gt;fly status&amp;lt;/code&amp;gt;/the dashboard). The Machines API lets each machine in an app carry its own image, so this machine runs the rendezvous image while the game machines run yours -- something a &amp;lt;code&amp;gt;fly.toml&amp;lt;/code&amp;gt;-driven &amp;lt;code&amp;gt;flyctl deploy&amp;lt;/code&amp;gt; can&amp;#039;t express, since that path is limited to one image per app. One app, one bill, one region to manage.&lt;br /&gt;
* &amp;lt;strong&amp;gt;&amp;lt;code&amp;gt;app&amp;lt;/code&amp;gt;&amp;lt;/strong&amp;gt;: a wholly separate Fly app, &amp;lt;code&amp;gt;&amp;amp;lt;name&amp;gt;-rendezvous&amp;lt;/code&amp;gt;, with its own (shared, since rendezvous is TCP-only and doesn&amp;#039;t need a dedicated address) IPv4 and its own lifecycle. Use this if you want to scale or redeploy rendezvous independently of the game app, or share one rendezvous app across several game-server apps. &amp;lt;code&amp;gt;mp-host destroy&amp;lt;/code&amp;gt; tears both apps down together.&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; declared in the game machine&amp;#039;s &amp;lt;code&amp;gt;services&amp;lt;/code&amp;gt; at creation -- Fly has no separate firewall step.&lt;br /&gt;
|-&lt;br /&gt;
| 8080&lt;br /&gt;
| TCP&lt;br /&gt;
| The rendezvous service: players resolve join codes here; declared in the rendezvous machine&amp;#039;s &amp;lt;code&amp;gt;services&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| health port&lt;br /&gt;
| not exposed&lt;br /&gt;
| No &amp;lt;code&amp;gt;&amp;amp;#91;[services.ports&amp;amp;#93;]&amp;lt;/code&amp;gt; entry; only a &amp;lt;code&amp;gt;fly.toml&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;tcp_checks&amp;lt;/code&amp;gt; entry for Fly&amp;#039;s own tracking.&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 Fly --name my-game-server --server-id my-game-server --image myorg/mygame --tag v2 ...&amp;lt;/code&amp;gt; finds the app&amp;#039;s current game machine and replaces its config in place through the Machines API -- Fly stops it and starts it again on the new image, keeping the same machine id (an in-place rolling restart like GenericVps&amp;#039;s &amp;lt;code&amp;gt;docker compose up -d&amp;lt;/code&amp;gt;, not a RunPod-style destroy-and-recreate), but still a brief connection drop since this profile runs one game machine per app. Scale to two machines behind Fly&amp;#039;s own load balancer first if a zero-downtime update matters more than cost. &amp;lt;code&amp;gt;mp-host destroy --profile Fly --name my-game-server --server-id my-game-server --yes&amp;lt;/code&amp;gt; destroys every machine in the app, the app itself, and -- in &amp;lt;code&amp;gt;app&amp;lt;/code&amp;gt; rendezvous mode -- the separate rendezvous app too.&lt;br /&gt;
&lt;br /&gt;
== Cost and sizing notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;shared-cpu-1x&amp;lt;/code&amp;gt; (1 shared vCPU, 256 MB RAM) is Fly&amp;#039;s smallest size and fine for a small-lobby real-time game server once you raise the memory with &amp;lt;code&amp;gt;--opt&amp;lt;/code&amp;gt;-equivalent sizing if your game needs more; step up to &amp;lt;code&amp;gt;shared-cpu-2x&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;4x&amp;lt;/code&amp;gt; or a &amp;lt;code&amp;gt;performance-*&amp;lt;/code&amp;gt; size for more players per instance. A dedicated IPv4 carries its own small monthly charge (verify Fly&amp;#039;s current price before committing) -- &amp;lt;code&amp;gt;mp-host destroy&amp;lt;/code&amp;gt; releases it along with the app, so nothing keeps billing after a test. Verify Fly&amp;#039;s current Machines API field shapes, region list and pricing against their live docs before relying on this for a public launch -- this is also why the real-provider smoke test (&amp;lt;code&amp;gt;tests/Hosting.Cli.Tests/Smoke/FlySmokeTests.cs&amp;lt;/code&amp;gt;) is opt-in rather than part of every build.&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/flyio.md Unity.Multiplayer/docs/articles/hosting/flyio.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>