Skip to content

External Shared Storage

Sometimes, you need data to live outside of your Terrarium server.

Why? Because some data is so important or so large that it shouldn't be tied to the lifespan of a single VPS.

Great examples include:

  • Massive knowledge bases or research corpora.
  • Long-term "memories" and logs generated by AI agents.
  • Media files you want to browse from your personal laptop.
  • Important documents that absolutely must survive even if your VPS is completely destroyed.

For these scenarios, the best approach is to connect an external cloud storage drive (like a Hetzner Storage Box) to your Terrarium host, and then share that connection with your containers.


The Workflow

The setup looks like this:

  1. Rent an external Storage Box.
  2. Tell Terrarium to mount it directly to the host machine.
  3. Pass that mounted folder into whatever containers need it.
  4. (Bonus) Mount that same Storage Box on your Macbook or Windows PC so you can interact with the files directly.

1. Get a Storage Box

For this example, we recommend a Hetzner Storage Box. They are incredibly cheap, support the SMB protocol, and work perfectly with Terrarium.

Make sure you know your:

  • Username: (e.g., u12345)
  • Password
  • Share Address: for the main account this is usually //u12345.your-storagebox.de/backup; for a subaccount it is usually //u12345-sub1.your-storagebox.de/u12345-sub1

2. Mount It to Terrarium

You don't need to manually edit Linux fstab files. terrariumctl has a built-in command to handle the messy work securely.

SSH into your host and run:

bash
terrariumctl mount add cifs /srv/shared/storage-box //u12345.your-storagebox.de/backup u12345

For a Storage Box subaccount, use the subaccount name in both the hostname and the share name:

bash
terrariumctl mount add cifs /srv/shared/storage-box //u12345-sub1.your-storagebox.de/u12345-sub1 u12345-sub1

Terrarium will safely ask for your password, establish an encrypted connection, and ensure the drive automatically reconnects if your server reboots.

(Want to check that it worked? Head over to your Cockpit dashboard at manage.<your-domain>, open the terminal, and type ls /srv/shared/storage-box to see your files.)

3. Give Containers Access

Now that the host is connected to the cloud drive, you can hand specific folders over to your containers.

Tip: Don't give a container access to the entire drive. Keep things organized. Create folders like /memories or /knowledge-base on the drive first.

Let's attach the /knowledge-base folder to an AI agent called openclaw:

The CLI Way:

bash
lxc config device add openclaw my-kb disk source=/srv/shared/storage-box/knowledge-base path=/mnt/knowledge-base

The Visual Way:

  1. Open your LXD UI at lxd.<your-domain>.
  2. Select your openclaw container and go to Devices.
  3. Click Add Device -> Disk.
  4. Source: /srv/shared/storage-box/knowledge-base
  5. Path: /mnt/knowledge-base

Now, whenever the openclaw container reads or writes to /mnt/knowledge-base, it is actually interacting with your Hetzner Storage Box in the cloud.

4. Mount It on Your Laptop

The best part of this setup is that the data isn't trapped in Terrarium.

Because Hetzner Storage Boxes use standard SMB protocols, you can natively mount the drive on macOS, Windows, or your local Linux machine. You can drag and drop PDFs into the knowledge base folder on your laptop, and your AI agents in Terrarium will see them instantly.


When Should I Not Use This?

External storage is slower than the local ZFS drive. If your containers need to rapidly read and write thousands of small files (like a database or an active code repository), do not put them on an external SMB drive. Use Local Shared Data instead.

Built with VitePress