> For the complete documentation index, see [llms.txt](https://docs.soniclabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/before-you-start.md).

# Before You Start

Gather the facts about your node that later steps rely on.

You'll need these answers in later steps. Write them down.

**1. What is your service called?**

```bash
systemctl list-units --type=service | grep -i sonic
```

This guide assumes it's called `sonic`. If yours is different (e.g. `sonicd`), replace `sonic` in every command.

**If nothing is printed**, the node isn't running as a service: you start it by hand, in `screen`/`tmux`, or with Docker. If you use Docker, read [Tier 5.3](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-5-stay-current.md) alongside this guide. Otherwise, set up a service first with the starter file in [**Appendix A**](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/appendix-a-starter-service-file.md), because Tiers 2 and 3 depend on it.

**2. Where is the service file, and what does it run?**

```bash
systemctl cat sonic
```

Note the path in `ExecStart=` (e.g. `/usr/local/bin/sonicd`), the `User=`, and the `--datadir=` folder (e.g. `/var/lib/sonic`).

Check that `ExecStart=` runs `sonicd` **directly**. If it runs a script (e.g. `start.sh`) or `/bin/bash -c "..."`, or if the file has `ExecStartPre=`/`ExecStartPost=` lines, [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md) will block them and the node won't start. Put the full `sonicd` command line straight into `ExecStart=` before you start [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md).

**Validators:** also note the file in `--validator.password=`. If it's in `/root` or a home folder, the node won't be able to read it once Tiers 1 and 2 are in place. Move it as described in [Validator Node](https://docs.soniclabs.com/pages/ycklmVREhe4bDmkq6Vvn#id-9.-run-your-validator-node), step 9.

**3. Which operating system and systemd version do you have?** Some protections need a recent version.

```bash
grep PRETTY_NAME /etc/os-release
systemctl --version | head -1
```

| Status          | Operating system                                                            | systemd      | [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md) support                                              |
| --------------- | --------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Recommended** | **Ubuntu 24.04 LTS**                                                        | 255          | Everything                                                                                                                                                      |
| Supported       | Ubuntu 22.04 or 26.04 LTS, Debian 12 or 13, RHEL 9 or 10 (and Rocky/Alma)   | 249 or newer | Everything                                                                                                                                                      |
| Outdated        | Ubuntu 20.04, RHEL 8 and its rebuilds, anything with systemd older than 249 | —            | **Key protections missing.** See "Older systems" in [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md). |

If you're setting up a new server, use the recommended version.

The port restrictions in [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md) (`SocketBind…`) also need systemd to be built with BPF support. Not every distribution build has it, so check:

```bash
systemctl --version | grep -o '[+-]BPF_FRAMEWORK'
```

`+BPF_FRAMEWORK` means port restrictions work. `-BPF_FRAMEWORK` (or no output) means systemd will accept those settings but **silently not enforce them**. Everything else in [Tier 2](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-2-lock-the-node-in-a-box.md) still works.

**4. Which ports does the node listen on?**

```bash
sudo ss -tulpn | grep sonicd
```

Example output:

```
udp   UNCONN  0  0   0.0.0.0:5050    0.0.0.0:*   users:(("sonicd",pid=1234,...))
tcp   LISTEN  0  128 0.0.0.0:5050    0.0.0.0:*   users:(("sonicd",...))
tcp   LISTEN  0  128 0.0.0.0:18545   0.0.0.0:*   users:(("sonicd",...))
tcp   LISTEN  0  128 0.0.0.0:18546   0.0.0.0:*   users:(("sonicd",...))
tcp   LISTEN  0  128 127.0.0.1:6060  0.0.0.0:*   users:(("sonicd",...))
```

{% hint style="info" %}
**Port numbers in this guide:** the examples use Sonic's defaults: `5050` for peer-to-peer, `18545` for HTTP RPC and `18546` for WebSocket RPC, plus `6060` for profiling/metrics. Wherever you see these numbers, use your own ports from this step.
{% endhint %}

How to read the address column:

* `0.0.0.0:18545` or `[::]:18545` means **anyone who can reach this server** can connect to port 18545.
* `127.0.0.1:6060` means **only programs on this same server** can connect. This is what you want for anything internal.
* `10.x.x.x`, `172.16–31.x.x`, `192.168.x.x` means anyone on that private network can connect.

**Validators:** expect only the peer-to-peer port (`5050`), plus `6060` if you turned on profiling or metrics. If you see `18545` or `18546`, RPC is on: turn it off ([Tier 1.3](https://docs.soniclabs.com/sonic/node-deployment/node-hardening/tier-1-essentials.md)).
