How to Install Routr on nixOS Latest

Routr is an open-source, lightweight and easy-to-use SIP server for VoIP communication. In this tutorial, we will guide you through the installation process of Routr on nixOS Latest.

Prerequisites

Before we begin, make sure that you have the following:

Steps

  1. Install Routr using the nix package manager.
$ sudo nix-env -i routr
  1. Create a Routr configuration file under /etc/routr with the following content:
listen: ":5060"
externalIP: "your_server_public_ip"
logging:
  level: debug
  filename: /var/log/routr.log
  format: '[%T] [%L] %M'
  maxSize: 10485760 # 10 MB
auth:
  type: basic
  realm: routr.com
  users:
    - username: alice
      password: alice
    - username: bob
      password: bob

Make sure to replace your_server_public_ip with your server's public IP address. This configuration file defines the listening port, logging options, and basic authentication credentials.

  1. Start Routr using systemd.
$ sudo systemctl start routr
  1. Verify that Routr is running by checking its status.
$ sudo systemctl status routr

You should see the following output:

● routr.service - Routr SIP Server
  Loaded: loaded (/nix/store/xs0msm43yvgp581fls4s0sxn4d4vkg1k-routr-0.13.2/lib/systemd/system/routr.service; enabled; vendor preset: enabled)
  Active: active (running) since Fri 2021-11-19 12:00:00 UTC; 5s ago
Main PID: 1234 (routr)
   Tasks: 5 (limit: 4915)
  Memory: 5.6M
     CPU: 252ms
  CGroup: /system.slice/routr.service
          └─1234 /nix/store/xs0msm43yvgp581fls4s0sxn4d4vkg1k-routr-0.13.2/bin/routr

Nov 19 12:00:00 localhost systemd[1]: Started Routr SIP Server.
  1. Finally, access Routr's web interface by opening your web browser and navigating to https://your_server_public_ip:4567. You should see the login page, where you can enter the authentication credentials defined in the configuration file.

Congratulations, you have successfully installed Routr on nixOS Latest!

Conclusion

In this tutorial, we have shown you how to install Routr on nixOS Latest using the nix package manager. We also created a simple configuration file and started Routr using systemd. Lastly, we accessed Routr's web interface to verify that it was running correctly.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!