Skip to main content

Tox Bootstrap Node on Debian 11

These steps have been tested on Debian 11

References:

Install Dependencies:

sudo apt update
sudo apt install git libnacl-dev libc6-dev cmake libconfig-dev libsodium-dev

Clone latest Git repository & submodules:

In your home directory or wherever you prefer to do compilation work:

git clone https://github.com/TokTok/c-toxcore.git
cd c-toxcore
git submodule update --init

Compile libtoxcore and tox-bootstrapd:

In the c-toxcore directory (you might be in it from the previous step):

mkdir _build
cd _build
cmake ..
make
make install

Did it Compile OK?

Verify the output text from make is all green and tox-bootstrapd was built:

[100%] Linking C executable tox-bootstrapd
[100%] Built target tox-bootstrapd

Create a tox-bootstrapd User & Restricted Home Directory:

sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
sudo chmod 700 /var/lib/tox-bootstrapd

Service & Configuration Files:

In the c-toxcore directory (cd .. if you're still in _build), copy the service and conf files to the system locations.  Keep in mind there is a directory structure under c-toxcore that is similar to the structure under _build, but the service and conf files are found under c-toxcore/other/bootstrap_daemon/ and the executable is found under c-toxcore/_build/other/bootstrap_daemon/.

Copy the service file to /etc/systemd/system/:
sudo cp other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/

If you will be using the default port number or a number greater than 1023, you can simply copy the service file and leave it as it is.  Otherwise, you will need to un-comment the line #CapabilityBoundingSet=CAP_NET_BIND_SERVICE.

Copy the configuration file to /etc/:
sudo cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf
Customize Configuration Settings:

Use nano or your favorite editor to edit /etc/tox-bootstrapd.conf:

sudo nano /etc/tox-bootstrapd.conf

At a minimum, edit your MOTD, other bootstrap nodes, and probably also your ports.  A current list of public bootstrap nodes is displayed at https://nodes.tox.chat/.

port = 33445

keys_file_path = "/var/lib/tox-bootstrapd/keys"

pid_file_path = "/var/run/tox-bootstrapd/tox-bootstrapd.pid"

enable_ipv6 = true

enable_ipv4_fallback = true

enable_lan_discovery = true

enable_tcp_relay = true

tcp_relay_ports = [3389, 33445, 43334]

enable_motd = true

motd = "Write Your Custom MOTD Here! (up to 255 chars)"

bootstrap_nodes = (
  { // Tony (he's awesome)
    address = "tox.abilinski.com"
    port = 33445
    public_key = "10C00EB250C3233E343E2AEBA07115A5C28920E9C8D29492F6D00B29049EDC7E"
  },
  { // Cody (he's awesome too)
    address = "198.199.98.108"
    port = 33445
    public_key = "BEF0CFB37AF874BD17B9A8F9FE64C75521DB95A37D33C5BDB00E9CF58659C04F"
  },
  { // Gabe (he's just a geek)
    address = "104.225.141.59"
    port = 43334
    public_key = "933BA20B2E258B4C0D475B6DECE90C7E827FE83EFA9655414E7841251B19A72C"
  }
)

Install the tox-bootstrapd Executable:

Copy the tox-bootstrapd executable from _build/other/bootstrap_daemon/ to /usr/local/bin/:

sudo cp _build/other/bootstrap_daemon/tox-bootstrapd /usr/local/bin/tox-bootstrapd

Enable & Start the systemd Service:

sudo systemctl daemon-reload
sudo systemctl enable tox-bootstrapd.service
sudo systemctl start tox-bootstrapd.service
sudo systemctl status tox-bootstrapd.service

Did the Service Start OK?

If systemctl start didn't produce any text and systemctl status shows active (running), then you should be up and running!

You can see what services are listening with:

sudo netstat -tunlp

Enable External Ports:

You may need to open ports listed in /etc/tox-bootstrapd.conf:

sudo ufw allow 33445
sudo ufw allow 3389/tcp

If you're not using ufw, you probably should be:

sudo apt update
sudo apt install ufw
sudo ufw allow ssh
sudo ufw enable

You can open a port only from a specific network interface (e.g. your VPN tunnel) using:

sudo ufw allow in on <interface> to any port <number>