# Public ports and static addresses

URL: https://heaven.dev/docs/ports
Updated: 2026-11-22

A public port puts a TCP service on the internet, such as a database, an SSH server or a game server. A static IPv4 address gives a Computer, a pool or an organization its own fixed address.

## Public ports

Heaven picks the public port and returns the host and port clients connect to. Anyone on the internet can connect, so the service must check who's connecting itself.

The Computer's owner, an admin, someone with Admin access to it or a member granted `port add` can publish a port, if the organization's [external sharing](https://heaven.dev/docs/access#external-sharing) setting allows it. An API key with a command list can't publish ports, so use a sign-in or a key without one. The pool needs a free port in its [allowance](#port-allowance).

In the Computer's **Networking** tab, choose **Open port** under **Ports**, enter the service's TCP port and choose **Open port** again.

```sh
heaven port add my-site 25565
```

Reference: [Publish a port](https://heaven.dev/docs/reference/computers/port-add).

## Port allowance

Public ports come with your capacity at no extra charge. An organization's pools on one server share 4 ports, plus 1 for each [unit](https://heaven.dev/docs/capacity#units) in a running pool, up to 20.

| Capacity on the server | Public ports |
| --- | ---: |
| One Tiny block | 5 |
| One Small block | 6 |
| One Medium block | 8 |
| One Big block | 12 |
| One Huge block or larger | 20 |

A pool can open at most 10 new ports in 24 hours, so one pool can't churn through a server's ports. Reopening a recently closed port doesn't count.

```sh
heaven port view my-site
```

It lists the Computer's ports, how many are left, and when the pool can open another if it hit the daily limit.

Reference: [List public ports](https://heaven.dev/docs/reference/computers/port-view).

## Close a port

Closing a port stops new connections, and open ones continue until they end. Opening the same service port again within 30 days can get the same public port number back. Choose **Close port** in the port's menu in the **Networking** tab.

```sh
heaven port remove my-site PUBLIC_PORT
```

Reference: [Close a port](https://heaven.dev/docs/reference/computers/port-remove).

## Static addresses

A static IPv4 address is a fixed address your organization [buys](https://heaven.dev/docs/pricing#static-addresses) and attaches to a Computer, a pool or the whole organization on a server. Use one when a partner allowlists your IP, or to reach a Computer's services directly.

| Attach to | What the address does |
| --- | --- |
| Computer | Receives TCP and UDP at the service's own port. The Computer also sends outbound IPv4 traffic from this address. |
| Pool | Carries outbound IPv4 traffic and published TCP ports for Computers in the pool that have no address of their own. |
| Organization | Provides the default address for pools on that server that have no address of their own. |

Outbound traffic leaves from the Computer's own address if it has one, then its pool's, then its organization's, and otherwise from the server's shared address.

## Buy an address

Admins and the billing owner buy addresses, from the CLI.

```sh
heaven ip buy --organization acme
heaven ip view --organization acme
```

Reference: [Buy static addresses](https://heaven.dev/docs/reference/addresses/buy), [List static addresses](https://heaven.dev/docs/reference/addresses/view).

## Attach an address

Each Computer, pool or organization can have one address. A Computer's owner or an admin can attach one to the Computer, and admins or the billing owner to a pool or the organization.

```sh
heaven ip attach ADDRESS my-site
heaven ip attach ADDRESS --pool web --organization acme
heaven ip attach ADDRESS --account --organization acme
```

If the organization is on several servers, add `--server` for the organization-wide one.

Reference: [Attach static addresses](https://heaven.dev/docs/reference/addresses/attach).

## Detach an address

A detached address stays with the organization to attach elsewhere. Public ports that used it keep their numbers on the next address in the order above, or close if there's none.

```sh
heaven ip detach ADDRESS --organization acme
```

Reference: [Detach static addresses](https://heaven.dev/docs/reference/addresses/detach).

## Release an address

Releasing an address ends its charges. For 12 hours only your organization can buy it back, with `ip buy --address ADDRESS`, which also gives you time to take it off allowlists before anyone else gets it.

```sh
heaven ip release ADDRESS --organization acme --yes
```

Reference: [Release static addresses](https://heaven.dev/docs/reference/addresses/release).
