Installing a Controller
The install runs on the machine that becomes the controller, from its console or over SSH. It has two phases: Phase 1 installs packages and needs no token, Phase 2 enrolls the machine and installs the controller. The CLI decides which one to run by inspecting the machine, so the same command is used after a reboot or after an interrupted run.
Before You Start
- Check the requirements.
- Use a machine dedicated to the controller. Phase 2 deletes every login user other than
rosepetal(UID 1000 or higher) together with its home directory, sets the hostname and disables the automatic apt upgrades. - Have the enrollment token at hand (
RPC1-XXXX-YYYY), or a Rosepetal account that is allowed to create the enrollment. - On a machine that already is a controller the install is a reinstall that erases its data: read Reinstalling a controller first.
Get the CLI
curl -fsSL https://storage.googleapis.com/rosepetal-cli-dist/install.sh | sudo bashThe script downloads the latest release to /usr/local/bin/rosepetal-cli. It has to run as root, hence sudo bash.
Start the Install
sudo rosepetal-cliChoose Install controller in the menu. Without sudo the entry is shown in red (needs sudo) and cannot be selected.
If the CLI finds a newer release when it starts, it first offers to update itself: see Updates.
Host Check
The CLI starts by listing what it finds on the machine:
- Docker, Tailscale and the OpenSSH server, each as present or missing.
- On a machine with an NVIDIA GPU, the NVIDIA driver and whether
nvidia-smiworks. - On a machine without an NVIDIA GPU, a line saying that the driver is not needed and that it will be installed as a CPU-only controller.
If a component is missing the install continues with Phase 1. Otherwise Phase 1 is skipped.
Phase 1
Phase 1 installs packages and nothing else: it creates no user, does not join Tailscale and needs no token. The CLI asks Proceed with Phase 1? and then runs six steps without further questions:
| Step | What it does |
|---|---|
| 1 | Updates the apt package index |
| 2 | Installs the baseline tools: git, vim, wget, curl, net-tools, ethtool, gnupg |
| 3 | Installs the OpenSSH server |
| 4 | Installs the NVIDIA driver that ubuntu-drivers autoinstall picks for the GPU and the running kernel. Skipped on a machine without an NVIDIA GPU |
| 5 | Installs Docker Engine from Docker's apt repository, with the compose plugin and nvidia-docker2 |
| 6 | Installs Tailscale with Tailscale's install script |
Steps 3 to 6 are skipped when the host check found their component present. Step 5 is skipped as a whole when the docker command already exists, nvidia-docker2 included.
If a step fails, fix the cause and run the CLI again: it checks the machine again and installs only what is still missing.
Reboot after the NVIDIA Driver
On a machine with an NVIDIA GPU the install goes on to Phase 2 only when nvidia-smi works. Right after the driver is installed it usually does not, because the kernel module is not loaded yet. The CLI then shows Reboot required and asks Reboot now?. It does not reboot at this point without asking.
After the reboot, log in, run sudo rosepetal-cli and choose Install controller again: the host check passes and the install continues with Phase 2.
Phase 2
Phase 2 turns the prepared machine into a controller. It opens with a summary of what it is about to do and the question Proceed?. Its steps are numbered 1 to 13 on screen:
| Step | What it does |
|---|---|
| 1 | Creates the user rosepetal, in the groups sudo and docker, and sets its password |
| 2 | Deletes every other login user (UID 1000 or higher) with its home directory. The account that runs the CLI is kept until the next reboot |
| Asks for the enrollment token and redeems it: see Enrollment token | |
| Hands the rest of the install to a background unit: see Background install. If a wipe was confirmed, it runs here | |
| 3 | Sets the hostname to the device name of the enrollment |
| 4 | Removes unattended-upgrades, disables the periodic apt runs and the release-upgrade prompt, disables apport |
| 5 | Installs and starts rosepetal-network.service, which applies the network tuning at every boot |
| 6 | Lowers the log level of tailscaled and restarts it |
| 7 | Joins Rosepetal's Tailscale network (tailnet) with the device name as hostname |
| 8 | Writes the controller's files to /opt/rosepetal/, among them docker-compose.yml, .env and proxy.sh |
| 9 | Downloads the images of the controller's modules (docker compose pull) |
| 10 | Downloads the auxiliary images that the Node-RED module declares for its nodes |
| 11 | Starts the containers (docker compose up -d) |
| 12 | Configures the Tailscale serves with /opt/rosepetal/proxy.sh. They are reachable from the tailnet only |
| 13 | Reports the install as complete to the Rosepetal API |
A failure in step 10, 12 or 13 is shown as a warning and the install goes on. A failure in any other step stops it. Troubleshooting lists the messages.
Enrollment Token
After step 2 the CLI asks How do you want to enroll this controller?
- Create the enrollment now (uses your Rosepetal account): sign in with the email and password of a Rosepetal account (a session opened with Sign in in the menu less than an hour before is reused), then choose the partner, the project, the versions of the modules and the device name. For the device name you type only the end: every device name starts with
rosepetal-dep-, which the screen shows in front of the field. If the API rejects the name, its message appears above the field and you can type another. The CLI creates the enrollment and uses its token directly. The account has to be allowed to create enrollments. Pressing Esc on the first screen of this option goes back to the question. - Paste an existing enrollment token: type the token, in the form
RPC1-XXXX-YYYY. Lower case is accepted. Tokens use the digits and the letters A to Z except I, L, O and U, so a character that looks like an O is a zero and one that looks like an I or an L is a one.
The CLI redeems the token against the Rosepetal API and prints the device name and the number of modules to install.
By this point steps 1 and 2 have already run: the user rosepetal exists and the other login users are deleted, even if the token is then rejected.
Background Install
Everything after the token can cut the session that runs the CLI, so it runs as a transient systemd unit, rosepetal-install. The CLI only follows its log, /var/log/rosepetal-install.log. Ctrl+C stops following the log; the install keeps running.
End of the Install
After step 13 the CLI prints Install complete with the device name and the number of modules, and the machine reboots by itself 20 seconds later. To cancel that reboot, within those 20 seconds:
sudo systemctl stop rosepetal-installWhen the install ran in the current session instead of the background unit (see Installing over SSH), the CLI shows a countdown instead: press Ctrl+C to cancel the reboot. Either way, run sudo reboot later to finish the install.
If the install was started from an account other than rosepetal or root, that account is removed during the next boot. In that case the summary of Phase 2 shows the password that rosepetal gets: note it before confirming.
After the reboot, log in as rosepetal and check the controller:
tailscale status
docker compose -f /opt/rosepetal/docker-compose.yml ps2
Installing over SSH
Installing over SSH is safe, even through the controller's own Tailscale address. Once the token is redeemed, the rest of the install (the wipe of a previous install, the Tailscale join, the image downloads, the final reboot) runs in the background unit, which keeps going if the session drops.
If you get disconnected, which is expected when the install resets the Tailscale identity you are connected through:
- Reconnect, to the LAN address of the machine or with
ssh rosepetal@<device-name>once the new Tailscale identity is up. - Run
sudo rosepetal-cliand choose Install controller again. The CLI attaches to the log of the running install instead of starting another one.
If the background unit cannot be started, the CLI says so and runs the rest of the install in the current session. In that case do not let the connection drop.
Machines without an NVIDIA GPU
A machine without an NVIDIA GPU is installed as a CPU-only controller. The host check looks for an NVIDIA display adapter on the PCI bus. With none, the driver step and the reboot check are skipped, and the CLI reports the machine as GPU-less when it redeems the token, so that the compose file of the controller carries no NVIDIA GPU reservations: Docker cannot start a container that reserves a GPU the machine does not have.
There is nothing to configure: it follows the hardware. The summary of Phase 2 says that the controller will be CPU-only, which is the moment to stop if a GPU was expected in the machine.
The GPU is reported when the token is redeemed: reinstalling after fitting a card picks the GPU up. A reinstall erases the data of the controller, as the next section describes.
Reinstalling a Controller
Before Phase 2 the CLI looks for traces of a previous install: /opt/rosepetal/docker-compose.yml, the directory /opt/storage (its size is shown), a Tailscale that is logged in to any tailnet, the rosepetal-network.service unit enabled, or a hostname that starts with rosepetal-dep-. If it finds any, it lists them under Existing state detected and asks Proceed with wipe + reinstall? The default answer is no.
Answering yes makes the install begin with a wipe of what was found:
- The containers of the controller and their volumes are stopped and deleted (
docker compose down -v), and/opt/rosepetalis removed. /opt/storageis removed: all the data of the controller, its local backups in/opt/storage/backupsincluded. This cannot be undone. When/opt/storageis a mount point of its own disk, the directory stays and is emptied.- Tailscale is logged out.
rosepetal-network.serviceis disabled and removed.
The install then continues as on a new machine, with the enrollment of the token that was redeemed and a new device key. The user rosepetal is kept.
The wipe is the first thing the background unit does, so nothing is wiped before the token has been redeemed. Answering no cancels the install: nothing is wiped.
This is a factory reset of the controller, not an update. To update a controller see Updates. To erase the data of a controller but keep its enrollment, its identity and its modules, use Clear controller instead, which takes a safety backup first.
Creating an Installer USB
The menu entry Create installer USB (section TOOLS) builds the Rosepetal installer image, an Ubuntu installation image with Rosepetal's automatic-install configuration, and writes it to a USB drive. Use the drive to install Ubuntu on the machine that becomes the controller. The entry runs on any Ubuntu machine and needs sudo; it does not need a controller or a signed-in account.
- The CLI installs what the build needs and is missing:
xorriso,gdisk,e2fsprogs,parted,ejectandwget. - It builds the image in
/var/cache/rosepetal-installer. The first build downloads about 3 GB, which stay in that directory for later builds. The image is built again only when the CLI has changed since the last build; otherwise the CLI says Reusing cached ISO. - It lists the USB drives, asks you to pick one and to confirm. Everything on the chosen drive is overwritten.
At the end the CLI prints Installer USB ready and returns to the menu.