1. [https://support.torproject.org/apt/tor-deb-repo/ Enable the Torproject package repository] to get the last version of tor
This can be considered optional on Debian but is not optional on Ubuntu. Do not use the packages in Ubuntu's universe. Get the repository sources to add to your /etc/apt/sources.list by running the configurator [https://support.torproject.org/apt/tor-deb-repo/ here]. Also ensure you import the GPG keys. This will make sure that you're running the latest stable version of tor.
2. Install the `tor` package
{{{
apt update && apt install tor
}}}
3. 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
}}}
4. Restart the tor daemon so your configuration changes take effect: