✉️contact@dadesktop.es 📞+34 911 43 64 28

How to Set Up a New DaDesktop Server

Deploying a DD Node on a GTHost or Hetzner Server

These notes are here to guide you through deploying a DaDesktop Node (Server) on a GTHost, Hetzner, or any comparable bare metal Linux server. Keep in mind that this guidance may change as the installation and deployment scripts evolve.


We'll assume you've already purchased a server and will be setting it up with Ubuntu Jammy 22.04. For faster disk access, you can use RAID0 (striping) if you have two or more disks and plenty of space. On Hetzner, you'll need to specify this via the 'installimage' process while in Rescue mode. 
 

Preparing and Installing the OS on a GTHost/Hetzner Server
 

Hetzner install
  1. Start by SSHing in with the provided root credentials. Run 'apt update' and 'apt upgrade' to bring all packages up to date. Afterwards, run 'apt autoremove' to clear out any outdated packages before upgrading.
  2. On Hetzner, you'll start in rescue mode, so you'll need to set up distribution requirements, software RAID (e.g., mdm, xfs, IPv4) before rebooting and upgrading. Typically, you'll accept the defaults for the small /boot and /boot/esp partitions that use ext4 (not xfs), and you won't need a swap partition. Assign the root (/) partition to xfs and let it use the remaining disk space.
  3. If you're using LeaseWeb or another provider, you'll have to change the main / filesystem from ext4 or btrfs to xfs. The following notes are just a suggestion; however, making sure the / partition uses xfs can be trickier than simply designating a /bigdisk for xfs, because any filesystem changes to / must be performed outside the operating system—you can't easily or safely change the / filesystem type while it's mounted.
  4. To create an xfs filesystem, use the provider's own tool if possible—it's much easier. Otherwise, you can do it from the rescue system like this:
    mkfs.xfs -f /dev/mdx (this formats / with xfs, and -f forces the overwrite). 
    Note: we no longer set up a separate /bigdisk partition; it's now just a directory under /.
  5. Mount the xfs filesystem using 'mount -t xfs /dev/mdX /' outside the OS, or use your system portal for this step.
  6. If you're still using a /bigdisk partition (now uncommon), add 'defaults,nofail 0 0' in /etc/fstab so the system can boot even if that partition fails to mount.
  7. Run 'systemctl daemon-reload' so systemd picks up changes to /etc/fstab.
  8. Use 'mount -a' to mount everything, then verify with 'df -T' that all partitions are created as expected.
  9. Finally, reboot the server.

     

Running the DaDesktop Installation Script

 

  1. SSH into the server, e.g., svr@xxxxxxxxx.
  2. Begin the installation using the DaDesktop install script.
  3. Fetch the installation script by running: curl http://npg.io/d > d
  4. Now, the base OS should be upgraded from 22.04 to the latest Ubuntu release—currently 23.10 Mantic, which will soon be 24.04 Noble.
  5. It's best to use the update-os script found at /apps/dadesktop_npnode_deploy/modules/00-upgrade-os for this. This approach is simpler than manual distribution upgrades—it switches the apt sources from jammy to mantic (or nautic) and lets you complete the upgrade in a single step. Although skipping releases is generally not recommended, it's safe here because only a small number of packages are installed.
  6. If DNS stops working during the distribution upgrade (we ran into this once), fix it with:
     rm /etc/resolv.conf ; echo "nameserver 8.8.8.8" > /etc/resolv.conf
  7. If you'd like, set a custom hostname such as lo33uk.npg.io, especially if you're recreating a DD node that had a specific name. Reboot afterwards if needed to apply the hostname.
  8. Then, execute the main install script. To avoid issues from a dropped SSH connection during the upgrade, consider using tmux. From the directory where the script was downloaded, run 'bash d'.
  9. Watch the on-screen logs for any errors. While the script runs, the server IP will automatically be added to the NP access list, though you might need to wait a minute or two for the whitelist cron job to update before you can proceed.
  10. Keep an eye on the script's progress, and fix or report any problems that arise.
  11. Run the cleanup script at /apps/dadesktop_npnode_deploy/modules/00-cleanup. It removes many unused packages and downgrades a few.
  12. Execute /apps/zabbix-agent/services/test-all.sh to catch any remaining problems.
  13. For any unmaintained packages, delete them with 'apt purge xxx yyy', and clean up any broken links you see.
  14. Finally, reboot and verify that everything works as expected.
     

Testing the DD Node After Installation

  1. In the DaDesktop GUI, check the new DD server entry and test it using TPAPI or similar tools.
  2. Set the server's start and expiry dates in DaDesktop, and add it to a datacenter if needed.
  3. Verify the server's status in Zabbix and resolve any issues.
  4. Test by adding a Standalone instance to the server and running it.
  5. If needed, assign the server to a Datacenter.
  6. Optionally, set up billing rules for the new server if required.
  7. Copy OS templates to the server if necessary.
  8. If this server will be used for a specific course, let the trainer or coordinator know.

 Enjoy!