Keep installs between runs

Three ways to have everything installed on the next rental, from free to full: the workspace, a setup script, and a saved environment image.

Every rental starts from a fresh container of the template's image. Three mechanisms bring your installs back, and they stack. Our recommendation for most people: setup script + workspace.

KeepsCostWorks on
1. Workspacepip / npm / conda packages, HF models, your code, outputsfree on the same host; checkpoint price elsewheresame host, or any host via a checkpoint
2. Setup scriptanything you can install with a command (apt, pip, git, wget)free, runs at every startany host
3. Environment imagethe whole container: apt, system config, CUDA extrasstorage per GB-month + upload timeany host

1. The workspace comes back by itself

Official images point the package managers at /workspace:

  • pip install → /workspace/.local (PIP_TARGET / PYTHONUSERBASE)
  • npm, conda, the Hugging Face cache → under /workspace/.cache
  • your repos, datasets, checkpoints → wherever you put them under /workspace

So on the same host with Keep a workspace on this machine ticked, stop and come back a week later and your pip installs are still there. On another machine, a FairGPU checkpoint (see Checkpoints and resuming) restores the same /workspace.

What this does not keep: apt packages, changes to /etc, anything in /root outside /workspace (for example the VS Code server). Those need tier 2 or 3.

2. Setup script (free, any host)

A bash script that runs once at container start, before your command and before the pod is marked ready. Up to 16 KiB, 30-minute limit. It is the right place for apt-get install, pip install -r requirements.txt, git clone, wget of a model.

Where to put it:

  • Rent wizard → Advanced: setup script for a single rental.
  • Templates: save it in your own template so every rental from it runs the script. The editor has a Setup script field under Advanced.
  • Rental page → Keep my environment → Turn my commands into a setup script: takes the successful runs from this rental's Commands panel and drafts the script for you; review it, then Save as template or Rent again with it.

Example:

#!/usr/bin/env bash
set -euo pipefail
apt-get update && apt-get install -y ffmpeg libgl1
cd /workspace
[ -d repo ] || git clone https://github.com/you/repo.git
pip install -r repo/requirements.txt

Make it idempotent ([ -d repo ] ||, pip install is already): it runs every start. Progress and errors appear as a system run called setup in the log viewer; if it fails, an interactive rental stays usable (you can fix things in the terminal) and a job rental is marked failed.

3. Environment image (paid, any host)

When you have spent an hour on apt packages, driver tweaks or a conda environment outside /workspace, save the container itself:

  1. On the running rental open Keep my environment → 3. Environment image → Save environment.
  2. The dialog shows the estimated size, the monthly storage price and the expected upload time from the host (typically 20–60 minutes for a 5–10 GB image; the rental keeps billing meanwhile).
  3. The host runs docker commit, compresses the image and uploads it in parts to FairGPU storage through one-time links. Progress shows on the card and on the timeline.
  4. Rent next time with the image: it appears under My environments in the rent wizard and under Templates → My environments with a Rent with this button. Its reference is fairgpu-env://<id>; you can also paste that as a custom image.

The host downloads it once (and keeps it cached, so the ⚡ ready in seconds chip applies on that machine afterwards). Pricing is the same per GB-month as checkpoints; delete images you no longer need from My environments.

Limits: images above the server's cap (40 GB by default) are refused; keep datasets and models in /workspace, not in the image.

Save as template

Whichever tier you use, Save as template (rental page header, wizard review step, or after generating a setup script) keeps image, ports, env, command, disk, setup script and checkpoint interval as a private template. Secret-looking env values are stored as required placeholders or secret references, never as values. Templates live under Templates → Mine and show up first in the rent wizard.

Remembered for you

  • Recent commands: every command you run from the Commands panel, a job's command field or fairgpu run is remembered (tokens masked). The Recent menu next to any command field searches, pins, renames and deletes them; ↑ in the field recalls like a shell. Clear history erases unpinned ones; Stop remembering turns it off and erases everything.
  • Last time: the wizard prefills your previous choices for the same template (duration, options, checkpoint interval, container disk) and shows Last time with this template: … under the command field.
  • Rent again: on any finished rental, one click reopens the wizard with everything from that rental, on the same machine if it is online, else on the marketplace filtered to the template.

All guides