This guide takes you from an empty server to a server linked to pissnet.

## Before you start

- Only do this if you plan to keep the server maintained and updated. A server that flaps or runs an old version is a problem for everyone.
- You need to be comfortable in a shell and able to debug your own config. People in `#opers` will help, but only you can fix your server.
- Don't run it on your home connection. A small VPS is plenty: an IRCd needs very little.

## Step 1: Build UnrealIRCd

Pissnet runs plain [UnrealIRCd](https://www.unrealircd.org). PissIRCd, the old pissnet fork, is retired.

Install the build dependencies. On Debian or Ubuntu:

```
sudo apt install build-essential pkg-config gdb libssl-dev libpcre2-dev libargon2-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev
```

Run the IRCd as its own user:

```
sudo adduser --disabled-password --gecos "" ircd
sudo -iu ircd
```

Download, build and install the latest stable release:

```
wget --trust-server-names https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz
tar xzvf unrealircd-*.tar.gz
cd unrealircd-*/
./Config
make
make install
```

The defaults in `./Config` are fine. UnrealIRCd installs to `~/unrealircd`. The [UnrealIRCd installation guide](https://www.unrealircd.org/docs/Installing_from_source) has the details.

**Prefer a package?** On Debian 12 or 13 and Ubuntu 22.04, 24.04 or 26.04, [freshdeb](https://www.freshdeb.com/unrealircd/) packages UnrealIRCd for apt, on amd64 and arm64. Follow the install steps on that page. The package runs UnrealIRCd as a systemd service under the `unrealircd` user, keeps its config in `/etc/unrealircd/unrealircd.conf` and doesn't support third-party modules. The rest of this guide assumes a source install in `~/unrealircd`, so adjust the paths and commands: test the config with `sudo runuser -u unrealircd -- unrealircd -c` and start it with `sudo systemctl start unrealircd`.

## Step 2: Configure it

```
cd ~/unrealircd
cp conf/examples/example.conf conf/unrealircd.conf
```

Edit `conf/unrealircd.conf`:

- `me {}`: `name` is your server's name, ideally a hostname that resolves to it. `info` is a free-text description. `sid` must be unique on the network: check the [server list](/servers?status=all) for one nobody uses.
- `admin {}`: how to reach you, for example your nick and an email address.
- `oper {}`: the example user is `bobsmith` with the password `test`. **Change both.**
- Network settings: the cloak module, network name and cloak keys have to match the rest of the network. Copy them from [Network settings](/docs/configuration#network-settings).

Then add hubs to link to:

- Open the [hubs in the server list](/servers?type=Hub), ping them from your server and pick the two or three closest.
- Paste their link blocks at the bottom of your config, or take them all from [/servers/link-blocks.conf?type=Hub](/servers/link-blocks.conf?type=Hub).
- Set up the `hubs` class and autoconnect as described in [Additional configs for servers](/docs/configuration).

Check the config and start the server:

```
./unrealircd configtest
./unrealircd start
```

Your firewall has to allow incoming connections on 6667, 6697 and 6900, the server link port. Connect with your IRC client and test `/oper`.

## Step 3: Get linked

Hubs only accept servers they know. Print your own link block:

```
./unrealircd genlinkblock
```

Paste it in `#opers` (or on a pastebin) and ask the admins of the hubs you picked to add it. Their nicks are in the comment above each link block. Once one of them adds you, your server connects on its own.

**Don't connect before a hub has added you.** Repeated connection attempts from an unknown server are treated as spam and end in a G-line.

## Step 4: After you link

- Ask in `#opers` to get your server added to the [server list](/servers).
- Read [So you linked to pissnet](/docs/after-linking).
