Skip to content

Installing YunoHost

Outcome: you understand exactly what the installer will do to a machine — because this chapter takes the real script apart — and what the postinstall then asks of you. The install itself is described from the project's documentation and its own script, both read by this guide's lab; it was not run on the lab's shared machine, and this chapter does not pretend otherwise.

There are two roads in. The ready-made images — for Raspberry Pi and similar boards, and for ordinary PCs — come with YunoHost already installed, so you write the image to a disk or card and jump straight to the postinstall. The second road, and the one that shows you the machinery, is installing on top of Debian: put a plain Debian 12 on the machine, then run YunoHost's installer over it. The documentation notes there is no difference in the resulting system; the images simply skip steps. This chapter follows the Debian road.

Step 0: plain Debian

The documentation's recipe is a minimal Debian 12 ("Bookworm") netinst install: use the whole disk, keep everything in one partition, install no desktop environment, keep "standard system utilities". Two details it flags:

  • Set a strong root password — until YunoHost is configured, it is the machine's primary defence.
  • Create the installer's ordinary user account with a name different from the first YunoHost user you will choose later (debian is their example). The two accounts live in different worlds, and giving them the same name invites confusion.

Step 1: the installer, dissected

Log in as root, make sure curl and ca-certificates are installed, and run the documented command:

curl https://install.yunohost.org | bash

Piping the internet into a root shell deserves one sceptical paragraph. The documentation makes the same point in its own way ("Always make sure there's an s at the end of https") and links to a discussion of the curl | bash pattern for advanced users. The cautious alternative costs nothing: download the script to a file first, read it — this guide's lab did exactly that — and run the file. What you will find is a 719-line bash script that does five things, in this order:

  1. Running system upgrades. It updates Debian completely first, so YunoHost is built on a current base.
  2. Install dependencies needed before the main install (the script calls this function, cheerfully, boring_workarounds).
  3. Set up the package source. It adds YunoHost's own repository — forge.yunohost.org/debian/ bookworm stable — with its GPG signing key, so YunoHost's packages install and update like Debian's own.
  4. Install the YunoHost packages — the core, the webadmin, and the considerable dependency list of chapter 2: nginx, the LDAP server, Postfix, Dovecot, Fail2ban and the rest arrive here.
  5. A conclusion that points you at the postinstall (step 2 below).

Before any of that, the script protects you from the two classic mistakes. Its checks, in its own words, refuse:

  • an Ubuntu or Linux Mint system — "You need a 'raw' Debian 12 (Bookworm)";
  • any Debian that is not version 12 — "YunoHost is only available for the version 12 (Bookworm) of Debian";
  • a non-root user — "This script must be run as root."

Then comes the confirmation, the most important screen in the install, quoted from the script itself:

Installing YunoHost requires to install various important services, and possibly rework the configuration of some services that may already be installed (such as: nginx, postfix, dovecot, fail2ban, slapd)

That is the whole bargain in one sentence, and it is why the lab did not run this script on a machine other people were using. A second prompt asks whether YunoHost may override the SSH configuration, warning that root SSH login will be disabled (except from the local network) in favour of the first YunoHost user, and that a custom SSH port will be reset to 22 — both changes taking effect at the postinstall, and both reversible later from inside YunoHost.

Step 2: the postinstall

The install leaves a configured system; the postinstall makes it yours. Run it from the web (the installer tells you the address — https://yunohost.local on a home network, or the server's public IP on a VPS) or from the command line as root:

yunohost tools postinstall

Your browser will object to the certificate on first visit: the server starts with a self-signed one. Chapter 7 replaces it properly; for now, the documentation's advice is to accept the exception once, knowingly — and not to make a habit of accepting such warnings elsewhere.

The postinstall asks for two things:

  1. The main domain. The domain from chapter 3. It becomes the portal's home and the base for your first email addresses. It can be changed later, and other domains can be added, but choose it as if it were permanent.
  2. The first user. A username and a robust password. This person is added to the Admins group: they can open the webadmin, connect by SSH, and receive the mail sent to root@ and admin@ addresses on the domain. The documentation notes this first user replaces the old-style admin account that older pages still mention.

Step 3: the expected mess, then order

Immediately after the postinstall, the documentation sends you to the diagnosis (chapter 10) and warns you the first run will show yellow and red alerts — almost always the unfinished DNS records of chapter 3 and, at home, unforwarded router ports. Fix those, then install the Let's Encrypt certificate from the domain's page in the webadmin, and the browser warnings end. From that point the machine is a YunoHost: ready for users (chapter 6) and apps (chapter 8).

One special case the documentation calls out: if you are restoring a server from a YunoHost backup, skip the postinstall entirely — the restore replaces it (chapter 11).