> Host Minecraft, Valheim, Terraria, and Factorio game servers from your PC. Let friends join without port forwarding or renting a server.

# Game Server Hosting

Want to play Minecraft with friends but don't want to rent a server or fight with port forwarding? Localport creates a public address for your local game server in one command. Share the address, and friends connect directly.

## How it works

Most game servers use TCP. Localport gives your server a public address with a dedicated port. Share that address with your friends and they join as if you were running a public server.

## Minecraft (Java Edition)

The most popular use case. Here's the full setup:

1. Start your Minecraft server (default port 25565)
2. Open a second terminal and run:

```bash
localport tcp 25565 --token YOUR_TOKEN
```

3. You'll see:

```
tcp → tcp://abc123.tunnel.localport.dev:47266
```

4. Send your friends: `abc123.tunnel.localport.dev:47266`
5. They go to Multiplayer → Add Server → paste the address → Join

That's it. No router config, no firewall rules.

> [!INFO] Bedrock Edition
> Minecraft Bedrock uses UDP on port 19132. Localport currently tunnels TCP traffic, so Bedrock isn't directly supported. Java Edition (which uses TCP) works perfectly.

## Valheim

```bash
localport tcp 2456 --token YOUR_TOKEN
```

Share the address with friends. They join through the server browser or direct connect.

## Terraria

```bash
localport tcp 7777 --token YOUR_TOKEN
```

## Factorio

```bash
localport tcp 34197 --token YOUR_TOKEN
```

## Quick reference

| Game | Default Port | Command |
|---|---|---|
| Minecraft (Java) | 25565 | `localport tcp 25565 --token YOUR_TOKEN` |
| Valheim | 2456 | `localport tcp 2456 --token YOUR_TOKEN` |
| Terraria | 7777 | `localport tcp 7777 --token YOUR_TOKEN` |
| Factorio | 34197 | `localport tcp 34197 --token YOUR_TOKEN` |

## Things to know

- **Latency is minimal** — Localport adds single-digit milliseconds. For most games, you won't notice.
- **Reserved ports** (any plan) — Keep the same address across sessions so friends don't need a new one every time.
- **Uptime** — The tunnel is active as long as the CLI is running. Close the terminal or shut down your PC and the tunnel closes.
- **Works behind any network** — University dorms, corporate WiFi, CGNAT, mobile hotspots. If you can browse the web, Localport works.

> [!TIP] Tip for regular game nights
> Reserve a port so your server always gets the same address. Save it as a server in your friends' game clients once, and it works every time.

## Next steps

- [TCP Tunnels](/docs/tcp-tunnels) — More about TCP tunneling
- [Installation](/docs/installation) — Get the CLI on your machine