Documentation / Getting started

Installation

Neti is installed with one command on a clean Debian 13 server. The command checks the machine, adds the signed Neti repository, installs the package and then runs neti setup, which configures this installation and prints the address of the console. The whole thing takes a few minutes.

On a server that meets the requirements, as root:

wget -qO- https://apt.lalospace.com/get-neti.sh | bash

The script does nothing until it has been downloaded completely: an interrupted download runs no command.

What the command does

The installer prints three numbered stages in English, then hands over to neti setup.

  1. System checks ([1/3] System checks): it must run as root, on Debian 13, amd64, with at least 1 GB of RAM and 4 GB of free disk on /. On a new installation the machine must be free: no nginx sites other than Debian's default one, ports 80/443 not in use by another program. If a check fails the installer stops with Installation stopped: … and Nothing was changed at this stage. When everything is fine it prints a line like ok: Debian 13, 1976 MB RAM, 17400 MB free.
  2. Signed repository ([2/3] Signed repository): it downloads the key of the Neti repository, compares its fingerprint with the one written inside the installer, checks that the file contains that key and no other, and adds the repository to APT (/etc/apt/sources.list.d/neti.list, key in /usr/share/keyrings/neti-archive-keyring.gpg). From then on Neti and its updates are accepted only if signed with that key. It ends with ok: signature verified (…) and the fingerprint.
  3. Package installation ([3/3] Package installation): it installs the neti package and its dependencies (see What gets installed). If APT fails, the message is Package not installed: run the command again to resume.
  4. Configuration (neti setup), started automatically; see What neti setup does.

What neti setup does

neti setup configures this particular server. Its messages are currently in Italian; each phase starts with a title in square brackets. The phases, in order:

[segreti] Keys and parameters of this installation
When run from a terminal it asks one question, Nome dell'istanza (the instance name), proposing the host name of the server: press Enter to accept it; you can change it later in the guided setup. Then it generates the secret key of the installation, a random port (between 20000 and 45000) and a random path for the console, a self-signed certificate for the console (valid 10 years, issued for the IP address of the server), the database, and the first-access token. All of this is unique to each server. If the configuration already exists it is kept (già presenti: non li rigenero).
[database] Database updates
Brings the database to the version of the installed code. Before any change it saves a snapshot in /var/lib/neti/backup.
[php] PHP of the console and of the gate
Writes Neti's own PHP pool, sized on the CPUs and memory of the server, and prints its size, for example pool neti: 16 processi al massimo. See Neti's PHP processes.
[console] Publishing the management console
Publishes the console on nginx at the random port and path, removes Debian's nginx welcome page so that it does not stay exposed, and enables fail2ban on the console: 5 failed sign-ins in 10 minutes ban the address for 1 hour; 2 probing requests in 10 minutes (requests to the console port with a wrong path, which get no answer, or malformed requests) ban it for 24 hours.
[firewall] Inbound rules
Enables the firewall (ufw) with inbound traffic denied by default, opening only SSH (on the port your SSH server really uses) and the console port. The activation must be confirmed: see Confirming the firewall. If ufw was already active, Neti only adds the console port and asks for no confirmation (firewall già attivo: aggiunta la porta della console).
[aggiornamenti] Debian security updates
Checks that Debian's automatic security updates are active (every day, without reboot) and warns if they are not. Neti itself is never updated automatically unless you decide so (see Updates). It also starts the first check for Neti updates in the background, so the Updates page is already filled when you open it; afterwards the check runs every 6 hours.
[verifica] Final check
Checks from inside the machine that nginx, PHP and fail2ban are running and that the console answers. Each line says attivo (running) or FERMO (stopped).
[pronto] Neti is installed
Prints the console address, the certificate fingerprint and the first-access link: see At the end.

If a phase fails, the command stops with ERRORE: … followed by Correggi il problema e rilancia: neti setup ("fix the problem and run neti setup again"). Every phase can be repeated safely: what already exists is kept.

Confirming the firewall

The firewall is enabled with an automatic rollback: if you do not confirm within 3 minutes (180 seconds), it turns itself off again. This protects you from being locked out if the SSH port is not the expected one.

  • If the installation is interactive (you ran it from a terminal), the command tells you to open a new SSH session now to verify that you can still get in, then to type ok in the first one. Any other answer, or no answer, leaves the rollback armed.
  • Otherwise (installation without a terminal, or with --auto), from a new SSH connection run: neti setup --confirm-firewall

While a confirmation is pending, neti status shows the line firewall: in attesa di conferma (neti setup --confirm-firewall). If the 3 minutes pass, the firewall is off: run neti setup again and confirm in time, or enable it later from the Firewall page of the console. The guided setup reports a firewall that is not active as a blocking problem in the Defenses step.

Ports 80 and 443 stay closed until you publish the first service: Neti opens and closes them by itself.

At the end

The command prints:

  • the console address (Console:), in the form https://IP:port/path. Port and path are random and appear nowhere else: save the address in your password manager;
  • the SHA-256 fingerprint of the console certificate (Impronta del certificato (SHA-256)): the browser will warn that the certificate is self-signed; check that the fingerprint the browser shows is the one printed here;
  • the first-access link (Primo accesso, apri questo link e crea l'amministratore): the console address followed by #t= and the setup token. It works only once and is used to create the administrator.

Continue with First access and guided setup.

Options of the installation command

Preview channel: NETI_CHANNEL=staging
Neti has two channels: stable (the default) receives the versions already tested; staging receives the previews. To install a new machine directly from staging, replace | bash with | NETI_CHANNEL=staging bash in the installation command. Any other value stops the installer with NETI_CHANNEL: stable or staging. For production use stable. The channel can be changed later in the console; see Updates.
Unattended installation: --auto
Arguments given to the installer are passed on to neti setup. With | bash -s -- --auto the setup asks no questions: the instance name is the host name and the firewall must be confirmed from a new connection with neti setup --confirm-firewall. The same happens by itself when the installer runs without a terminal (for example from a provisioning script).

Useful commands

The complete reference is in The neti command. The ones you may need right after the installation:

neti status
State of the system services, Neti's PHP processes (see Neti's PHP processes) and the console address.
neti setup
Repeats the configuration (if something went wrong). Keys, console address and database are kept.
neti setup --confirm-firewall
Confirms the firewall that has just been enabled.
neti setup --refresh
Updates the database and regenerates the console and the published services (it runs by itself after an update).
neti migrate
Only the database update, with a copy saved first in /var/lib/neti/backup (the last 5 are kept).

If something goes wrong

The installer stops with Installation stopped: …
The message says what is missing (system, RAM, disk, a machine that already hosts websites, network or DNS for APT, repository key). Fix it and run the command again: it resumes from where it is needed.
key fingerprint mismatch or the repository key file holds N keys, expected 1
The key downloaded from the repository is not the one the installer expects. Nothing has been installed. Do not work around it: download the installer again from the official address and retry.
Package not installed: run the command again to resume.
APT could not install the package (network, a lock held by another APT run). Run the installation command again.
neti setup stops with ERRORE: …
Fix the problem named in the message and run neti setup. Until the setup has completed, neti status prints non configurato: esegui neti setup.
You locked yourself out after the firewall was enabled
Wait 3 minutes: without confirmation the firewall turns itself off.
You lost the output with the console address
Run neti status: the last line is the console address.
You lost the first-access link, or it no longer works
As long as no user exists, generate a new token on the server, as root: /opt/neti/bin/sysagent.sh setup-token-new. Open the console address and paste the token in the Setup token field. See Creating the administrator.

Removing Neti

apt remove neti removes the program and takes the console offline, and removes Neti's SSH access filter so that SSH answers everyone again; configuration, database, logs and the published services' files stay on disk. apt purge neti also deletes them: /etc/neti, /var/lib/neti, /var/log/neti, the nginx files of the console and of the published services, the fail2ban rules and Neti's PHP pool. A purge cannot be undone: download a backup first (see Backup).

Community

Community

Discussion board. Sign in to open topics and reply.

Loading…

The same account works for Community and Console.

Complete your profile

Your profile

One more step to join the community.

My posts

Your discussions and replies.