# Enrolling a Lighthouse

:::info

Every new network already includes a [managed lighthouse](/docs/get-started/managed-lighthouses/), so this step is optional. Follow this guide if you'd prefer to run your own lighthouse for more control over your network infrastructure.

:::

In a Managed Nebula network, [hosts](/docs/glossary/host/) discover each other via [lighthouses](/docs/glossary/lighthouse/). To create a lighthouse, you will need a lightweight server on a persistent public IPv4 address. Additionally, you'll want to use a machine that is always-on rather than a serverless platform, since the lighthouse is a stateful process.

To start enrolling a lighthouse, visit the [hosts page](https://admin.defined.net/hosts?filter.type=lighthouse) of the admin panel and choose "Add lighthouse" from the "Add host" menu.

<figure>
  <Image
    src={addLighthouseForm}
    alt="The 'Add a lighthouse' form in the admin panel. Requires a name, public IP, port and role selected from a dropdown list."
    class="screenshot-shadow"
  />
</figure>

Give the lighthouse a name and enter the machine's public IPv4 address and the port you opened to allow UDP inputs (default `4242`). You can also assign the lighthouse a [role](/docs/glossary/role/), which controls what inbound traffic it accepts from other hosts — choose an existing role or create a new one directly from the dropdown. Newly created roles only accept `ping` requests from other hosts, which is handy for verifying connectivity. You'll be able to edit the role's firewall rules later if desired.

:::info

You’ll need to open the machine's firewall for UDP port `4242` (or some other configured port) in order for any host to be able to query the lighthouse, on both IPv4 and IPv6 ports to allow hosts on all types of networks to communicate.

:::

Now that you have created your lighthouse, choose your host's operating system and version, then follow the instructions in the admin panel to install [DNClient](/docs/glossary/dnclient/), start it as a startup service, and enroll the machine into the Managed Nebula network.

<figure>
  <Image
    src={lighthouseEnrollScreen}
    alt="Enroll page for a new lighthouse named 'My First Lighthouse'. It shows options for choosing an operating system and version, and then instructions for how to install and run DNClient."
    class="screenshot-shadow"
  />
</figure>

Once you’ve enrolled a lighthouse, you can start setting up other hosts and using `ping` with their Managed Nebula IP addresses to verify that they are able to communicate with each other via the lighthouse over your Managed Nebula network.
