veilid/INSTALL.md
Christien Rioux aaea2aebbf Merge branch 'tmcarr-main-patch-16887' into 'main'
Update INSTALL.md to keep the suggested crontab from updating all packages on the users system.

See merge request veilid/veilid!306
2024-08-15 12:33:48 +00:00

7.2 KiB

Install and run a Veilid Node

Server Grade Headless Nodes

These network support nodes are heavier than the node a user would establish on their phone in the form of a chat or social media application. A cloud based virtual private server (VPS), such as Digital Ocean Droplets or AWS EC2, with high bandwidth, processing resources, and uptime availability is crucial for building the fast, secure, and private routing that Veilid is built to provide.

Install

Debian

Follow the steps here to add the repo to a Debian based system and install Veilid.

Step 1: Add the GPG keys to your operating systems keyring.
Explanation: The wget command downloads the public key, and the sudo gpg command adds the public key to the keyring.

wget -O- https://packages.veilid.net/gpg/veilid-packages-key.public | sudo gpg --dearmor -o /usr/share/keyrings/veilid-packages-keyring.gpg

Step 2: Identify your architecture
Explanation: The following command will tell you what type of CPU your system is running

dpkg --print-architecture

Step 3: Add Veilid to your list of available software.
Explanation: Use the result of your command in Step 2 and run one of the following:

  • For STABLE releases

    • AMD64 based systems run this command:
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/veilid-packages-keyring.gpg] https://packages.veilid.net/apt stable main" | sudo tee /etc/apt/sources.list.d/veilid.list 1>/dev/null
    
    • ARM64 based systems run this command:
    echo "deb [arch=arm64 signed-by=/usr/share/keyrings/veilid-packages-keyring.gpg] https://packages.veilid.net/apt stable main" | sudo tee /etc/apt/sources.list.d/veilid.list 1>/dev/null
    
  • For NIGHTLY (bleeding edge) releases

    • AMD64 based systems run this command:
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/veilid-packages-keyring.gpg] https://packages.veilid.net/apt nightly main" | sudo tee /etc/apt/sources.list.d/veilid.list 1>/dev/null
    
    • ARM64 based systems run this command:
    echo "deb [arch=arm64 signed-by=/usr/share/keyrings/veilid-packages-keyring.gpg] https://packages.veilid.net/apt nightly main" | sudo tee /etc/apt/sources.list.d/veilid.list 1>/dev/null
    

Explanation: Each of the above commands will create a new file called veilid.list in the /etc/apt/sources.list.d/. This file contains instructions that tell the operating system where to download Veilid.

Step 4: Refresh the package manager.
Explanation: This tells the apt package manager to rebuild the list of available software using the files in /etc/apt/sources.list.d/ directory.

sudo apt update

Step 5: Install Veilid.

sudo apt install veilid-server veilid-cli

Step 6: Start veilid-server.service

Go to Start headless node

Step 7: View Node Activity

Invoke the Veilid CLI utility.

Either add your user to the veilid group and invoke the command

veilid-cli

Or use sudo to invoke as the veilid user

sudo -u veilid veilid-cli

RPM-based

Follow the steps here to add the repo to RPM-based systems (CentOS, Rocky Linux, AlmaLinux, Fedora, etc.) and install Veilid.

Step 1: Add Veilid to your list of available software.

  • For STABLE releases
sudo dnf config-manager --add-repo https://packages.veilid.net/rpm/stable/x86_64/veilid-stable-x86_64-rpm.repo
  • For NIGHTLY (bleeding edge) releases
sudo dnf config-manager --add-repo https://packages.veilid.net/rpm/nightly/x86_64/veilid-nightly-x86_64-rpm.repo

Step 2: Install Veilid.

sudo dnf install veilid-server veilid-cli

Step 3: Start veilid-server.service

Go to Start headless node

Step 4: View Node Activity

Invoke the Veilid CLI utility.

Either add your user to the veilid group and invoke the command

veilid-cli

Or use sudo to invoke as the veilid user

sudo -u veilid veilid-cli

Setup Auto Updates

Stable Releases

We set the bootstrap nodes to check for updates every hour by using crontab

On a Debian based machine:

sudo crontab -e

In the editor that opens append:

0 * * * * apt -y update && apt -y upgrade --only-upgrade veilid-cli veilid-server > ~/auto_updates.log 2>&1

Nightly Releases

The nightly auto release triggers at 11PM US Central Time. The following crontab exmaple will trigger at 6AM for your machine's local time which should give plenty of time for the auto release to complete no matter where you are in the world.

sudo crontab -e

In the editor that opens append:

* 6 * * * apt -y update && apt -y upgrade veilid-cli veilid-server > ~/auto_updates.log 2>&1

Fedora Based Machines

The above steps should work, replace the apt commands with appropriate dnf commands.

macOS

Not maintained by the Veilid team. Seek assistance in the Discord community.

Veilid is available via Homebrew.

brew install veilid

You can then run veilid-server and veilid-cli from the command line.

Start headless node

With systemd

To start a headless Veilid node, run:

sudo systemctl start veilid-server.service

-OR-

To have your headless Veilid node start at boot:

sudo systemctl enable --now veilid-server.service

Without systemd

veilid-server must be run as the veilid user.

To start your headless Veilid node without systemd, run:

sudo -u veilid veilid-server

Configuration

You can find the default location of the server configuration for your platform in the help text:

/path/to/veilid-server -h

Information on configuring veilid-server can be found in the Developer Book and examples are available in the doc directory of this repository.

Logging

veilid-server has extensive logging functionality that can be configured via the configuration file or changed while running using veilid-cli's change_log_level command. The default log settings for veilid-server packages are:

  • Linux - INFO log level to syslog (usually /var/log/syslog)
  • Mac OS - INFO log level to syslog (usually /var/log/system.log)

Network Considerations

note: if you're interested in using a veilid-server node for local development, you're better off reading the Developer Book, though the implementation to enable local development using a veilid-server node is still forthcoming.

Veilid nodes need to be internet facing or behind a firewall that allows inbound connections via port 5150 for both TCP and UDP. This will allow veilid-server to access other nodes in the wider network since 5150 is the port that the process uses by default. If the port is not available, veilid-server will wait for it to become available.

In the event the listening port is not opened in the firewall, an application may still operate, though in a fairly degraded mode that relies on another node to relay incoming RPC messages to them.