_model: page
---
color: primary
---
title: Debian/Ubuntu
---
body:

# 1. Enable Automatic Software Updates

One of the most imported things to keeps your relay secure is to install security updates timely and ideally automatically so you can not forget about it. Follow the instructions to enable [automatic software updates](updates) for your operating system.

# 2. Configure Tor Package Repository

Enable the Torproject package repository by following the instructions **[here](https://support.torproject.org/apt/tor-deb-repo/)**.

# 3. Package Installation

Install the `tor` package:

`apt update && apt install tor`

# 4. Configuration File

Put the configuration file `/etc/tor/torrc` in place:

```
#change the nickname "myNiceRelay" to a name that you like
Nickname myNiceRelay
ORPort 443
ExitRelay 0
SocksPort 0
ControlSocket 0
# Change the email address bellow and be aware that it will be published
ContactInfo tor-operator@your-emailaddress-domain
```

# 5. Restart the Service

Restart the tor daemon so your configuration changes take effect:

`systemctl restart tor@default`

# 6. Final notes

If you are having troubles setting up your relay, have a look at our [help section](/relay/getting-help/). If your relay is now running, check out the [post-install](/relay/setup/post-install/) notes.
---
html: two-columns-page.html
---
key: 1
---
section: Middle/Guard relay
---
section_id: relay-operations
---
subtitle: How to deploy a middle/Guard relay on Debian/Ubuntu
---
_discoverable: yes
