# Get started with networks

> Put a Paper server into a Minekube network without writing any code - install the Minekube plugin, log in, create a network, let the server in with an invite, and join it from Minecraft.

> **Preview: Connect in the Minekube plugin:**
> This guide uses networks in the Minekube plugin, the next generation of Connect, on staging. For a public address with today's Connect plugin, follow the [Connect quick start](https://minekube.com/guide/quick-start).

In this guide you put a Paper server into a network of your own. Players then join the network's address, and the server needs no open port. You write no code.

**You need:**

- A Paper server for Minecraft 1.21 or newer, running on Java 22 or newer. The connector needs Java 22.
- [Bun](https://bun.sh) 1.4.4 or newer, for the Minekube CLI.
- Minecraft: Java Edition, to log in and to join.

## 1. Install the CLI

```sh
bun add -g https://github.com/minekube/minekube/releases/latest/download/minekube-cli.tgz
```

The CLI is `minekube`, and `mk` for short. During the preview, point it at the staging registry:

```sh
export MINEKUBE_REGISTRY=https://registry.staging.minekube.net
```

## 2. Log in and create a network

1. Join the Minekube hub at `play.staging.minekube.net` with Minecraft.

2. Run `mk login`, click **[Log in]** in the hub's chat and enter the code it shows.

3. Create your network:

   ```sh
   mk network create my-network
   ```

The name must be free. Your account owns the network.

## 3. Install the Minekube plugin

Download the Minekube plugin for Paper from the [latest release](https://github.com/minekube/minekube/releases/latest), `minekube-paper-runtime.jar`, into the server's `plugins/` folder. Start the server once and stop it again. The plugin creates its folder, `plugins/Minekube/`.

## 4. Let the server in

Make a one-time invite for the server:

```sh
mk network invite my-network
```

It prints a token that works once, for an hour. On the server, write the token to `plugins/Minekube/network-invite`. Then create `plugins/Minekube/connector.json`:

```json title="plugins/Minekube/connector.json"
{
  "directory": { "registry": "https://registry.staging.minekube.net" },
  "relays": ["https://relay.staging.minekube.net/"],
  "join": { "network": "my-network", "token": "network-invite" },
  "labels": { "minekube.com/entry": "true" }
}
```

- `directory` names the registry, and `relays` the relays the connector may use.
- `join` names the network and the file with the invite. Paths are relative to the plugin folder.
- The label `minekube.com/entry=true` marks this server as the one players land on when they join the network's address.

Keep `online-mode=true` in `server.properties`: anyone can reach the server now.

Start the server. The connector makes the server's key, shows the invite once, and from then on the key is in the network.

## 5. Check and join

```sh
mk instances --network my-network
```

The list shows your server, its labels and whether it is online. In Minecraft, join `my-network.staging.minekube.net`. You land on your server, through the relay, with no open port.

## Next steps

- [Let servers in](https://minekube.com/guide/networks/let-servers-in): trust rules for Kubernetes and CI, and your dev server with one flag.
- [Labels and selectors](https://minekube.com/guide/networks/labels): give servers labels and pick them by selector.
- [Publish a revision](https://minekube.com/games/versions-and-deployments/publish): run [Games](https://minekube.com/games/overview) bundles on the servers of your network.
