Skip to content

Set Up Garage on a Linux Server – S3-Compatible Object Storage for Backups and Applications

Run Garage as lightweight S3 storage on your VPS: use the One-Click App or Docker Compose, create buckets and keys, connect rclone, and set up backups.

1 December 202612 min read0 Views0 helpful

Introduction

Garage is lightweight, self-hosted, S3-compatible object storage. It is developed by the French collective Deuxfleurs, and its source code is open source. Garage stores files as objects in buckets and uses the Amazon Web Services S3 API. This means that programs that can store data in S3 can also write to your own Garage storage without modification. Examples include backup tools such as rclone, restic, or Duplicati; Nextcloud as external storage; and your own applications through an S3 SDK. Garage is designed to run on multiple servers, but it also runs on a single VPS. In this guide, we’ll show you two ways to set it up: the easy way as a One-Click App and a manual installation with Docker Compose. Then you’ll create buckets and access keys and use Garage with rclone and as a backup target.

When Garage Makes Sense on a VPS

Garage is a good choice when you need S3-compatible storage but want your data to remain on your own server. Garage is a good fit for a VPS if:

  • You’re looking for a backup target for other servers or computers. Many backup programs can back up directly to an S3 bucket, with a separate access key for each device.
  • Your application needs to store files in S3, such as uploads from a web app, media from a CMS, or artifacts from a CI pipeline.
  • You want to develop and test S3 code without using an account with a cloud provider.
  • You want to control storage and access yourself: storage capacity through your VPS’s disk, permissions for each bucket and key, and quotas for each bucket.
  • You’re looking for a lightweight alternative to MinIO. Both are S3-compatible object storage solutions. Garage uses little memory and is designed to be distributed across multiple locations with minimal effort. There is no MinIO One-Click App; Garage is your option for S3 in the app catalog.

Garage is less suitable if you want to upload and share files in a browser. Garage doesn’t include a web interface for files; a cloud service such as Nextcloud is designed for that. If you only need a destination for copying files over SSH, Rsync is enough. Also, Garage on a single VPS stores each object only once: if the disk fails, only an additional backup can help.

The Easy Way: Garage as a One-Click App

The quickest way to get Garage running is through your VPS’s One-Click Apps. The app starts Garage in single-node mode, sets up the storage layout automatically, and creates an initial bucket and access key. The S3 API is directly accessible over HTTPS, so you don’t need a reverse proxy or certificate.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See One-Click Apps for instructions.
  • Enough free storage for your data. Garage itself needs little memory and CPU; the usable capacity depends on your VPS’s disk. The app reports the entire disk as its capacity. You can set a quota for each bucket yourself (see below).

Install

  1. Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
  2. Search the app catalog for Garage and click Install on its card.
  3. Give the app a name under App name, for example garage.
  4. You don’t need to fill anything in under App configuration. GARAGE_DEFAULT_BUCKET is the name of the first bucket; the default is default. Enter a custom name here if you already know what you want to call it, for example backups. Leave the GARAGE_S3_API_URL, GARAGE_WEB_URL, and GARAGE_ADMIN_URL fields empty; they’ll be populated during installation.
  5. Under Automatically generated values, you can see which secrets the app will generate during installation. You don’t need to enter anything here.
  6. Click Queue installation.

After about a minute, the app will show as Online. The app card displays the S3 access notice: Garage doesn’t have a web interface, so you use it with an S3 program. There is no Access link for this reason.

Find the Endpoint and Access Keys

The One-Click App generates all secrets automatically: the RPC secret for internal communication (64 hexadecimal characters, or 32 bytes), the token for the admin API, and the first S3 access key. You can find them in the app settings:

  1. Click the gear icon on the app card and go to App environment.
  2. Under App configuration, GARAGE_S3_API_URL contains the S3 API address. This is the endpoint you enter in your programs.
  3. Under Automatically generated values, find SERVICE_HEX_32_GARAGEACCESSKEY (access key) and SERVICE_PASSWORD_64_GARAGE (secret key) for the first bucket. Click the eye icon to show a value, or the icon next to it to copy it.

The One-Click App’s access key is a random value made up of 32 hexadecimal characters. It looks different from keys generated by garage key create (which start with GK), but works the same way. You can’t change this key in the settings. If a program needs its own key, create one as described below.

Use the following settings in your programs:

SettingValue
EndpointAddress from GARAGE_S3_API_URL
Regiongarage
Access KeySERVICE_HEX_32_GARAGEACCESSKEY
Secret KeySERVICE_PASSWORD_64_GARAGE
BucketValue from GARAGE_DEFAULT_BUCKET (default default)
AddressingPath style
Info: Enable path style

In this app, Garage expects the bucket name in the address path (https://endpoint/bucket/file), not as a subdomain. In most programs, the option is called “Path Style,” “Force Path Style,” or “Path Addressing.” If you don’t enable it, connections will fail with an address-related error.

What Is Accessible from the Internet

The app provides three addresses over HTTPS. It doesn’t open ports on your VPS’s IP address:

  • GARAGE_S3_API_URL points to the S3 API (internal port 3900). Without a valid access key, Garage responds with “Access Denied”; anonymous access is not available.
  • GARAGE_ADMIN_URL points to the admin API (port 3903). Apart from the /health status page, it requires the token generated in SERVICE_PASSWORD_GARAGE.
  • GARAGE_WEB_URL points to the web server for static websites hosted in buckets (port 3902). Without a published bucket, it only displays “404 Not Found.”

The port for communication between Garage nodes (3901) remains inside the Docker network.

Manage Buckets and Keys

Garage doesn’t include a web interface. Create additional buckets and keys with the garage command in the container. To do so, connect to your VPS over SSH and find the container name:

Code
docker ps --format '{{.Names}}' | grep '^garage-'

Use this name to run Garage commands. The status confirms that the node is running and the layout is set up:

Code
docker exec garage-CONTAINER /garage status

See Create Buckets and Access Keys below for instructions on creating buckets, keys, and permissions. With the One-Click App, prefix each command with docker exec garage-CONTAINER.

Updates and Backups

Update Garage in the app settings (gear icon), under App update. Click Check for updates, then install a new version with Apply update. If the app is up to date, there isn’t a newer version in the app catalog yet.

Buckets, objects, keys, and permissions are stored in the app’s volumes (garage-meta for metadata and garage-data for data blocks) and are preserved during updates and restarts. For a full backup, use your VPS Backups in the dashboard (see Daily Backups and Restores). If Garage itself contains backups from other servers, keep a copy on a second system; see Limitations of Single-Node Operation for more information.

Manual Installation

If you don’t use One-Click Apps or want to configure Garage yourself, set it up with Docker Compose. We’ll use the official dxflrs/garage image.

Requirements

  • A VPS running Debian or Ubuntu, with root access over SSH.
  • Docker and Docker Compose. See Set Up Docker on a Linux Server.
  • For HTTPS, a domain or subdomain with an A record pointing to your VPS’s IP address, for example s3.example.com.
ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM1 GB2 GB
Storage20 GBAs much as you want to store, plus extra capacity

Garage itself needs little RAM and CPU. Your data determines how much disk space you need. Metadata is stored in a small database that benefits from fast storage. This is available on VPS NVMe disks.

Prepare the Firewall

The S3 API should only be accessible over HTTPS. Therefore, open only SSH and the ports for the reverse proxy:

Code
apt install ufw -y
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable

In the Compose file, bind Garage ports 3900 to 3903 to 127.0.0.1 only. This makes them inaccessible from the outside, even if Docker sets its own firewall rules. See Open Ports and Manage the Firewall on Linux for more information.

Install with Docker Compose

Create a directory and generate the secrets. The RPC secret must consist of 64 hexadecimal characters:

Code
mkdir -p /opt/garage && cd /opt/garage
echo "GARAGE_RPC_SECRET=$(openssl rand -hex 32)" > .env
echo "GARAGE_ADMIN_TOKEN=$(openssl rand -base64 32)" >> .env
echo "GARAGE_METRICS_TOKEN=$(openssl rand -base64 32)" >> .env
chmod 600 .env

Create the configuration file garage.toml:

Code
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "lmdb"

replication_factor = 1

rpc_bind_addr = "[::]:3901"
rpc_secret_file = "env:GARAGE_RPC_SECRET"

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.example.com"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.example.com"

[admin]
api_bind_addr = "[::]:3903"
admin_token_file = "env:GARAGE_ADMIN_TOKEN"
metrics_token_file = "env:GARAGE_METRICS_TOKEN"

Then create the docker-compose.yml file:

Code
services:
  garage:
    image: dxflrs/garage:v2.5.0
    container_name: garage
    restart: unless-stopped
    command: ["/garage", "server", "--single-node"]
    env_file: .env
    environment:
      - GARAGE_ALLOW_WORLD_READABLE_SECRETS=true
    volumes:
      - ./garage.toml:/etc/garage.toml:ro
      - ./meta:/var/lib/garage/meta
      - ./data:/var/lib/garage/data
    ports:
      - "127.0.0.1:3900:3900"
      - "127.0.0.1:3902:3902"
      - "127.0.0.1:3903:3903"

The most important lines:

  • replication_factor = 1 stores each object once. This is the right setting for a single server.
  • --single-node automatically sets up the storage layout for this one node at startup. Without this option, you have to assign the layout manually before creating the first bucket (garage layout assign and garage layout apply; see the documentation).
  • rpc_secret_file, admin_token_file, and metrics_token_file read the secrets from .env. Without an admin token, the admin API wouldn’t be usable.
  • GARAGE_ALLOW_WORLD_READABLE_SECRETS=true disables Garage’s check of file permissions for secrets, just as the One-Click App does. Protect the .env file yourself with chmod 600.
  • Using 127.0.0.1 in ports makes the APIs accessible only to the reverse proxy on the same server. You only need port 3901 when you add more Garage nodes.

Start Garage:

Code
docker compose up -d

First Check

Check that the node is running and the layout is set up:

Code
docker exec garage /garage status
docker exec garage /garage layout show

status lists your node under HEALTHY NODES with the capacity of your disk. layout show displays the same node under CURRENT CLUSTER LAYOUT with 100% of the usable capacity. Then create a bucket and key as described in Create Buckets and Access Keys.

Access Over HTTPS Through a Reverse Proxy

To let programs connect to Garage securely through https://s3.example.com, put nginx in front of it as a reverse proxy. See Set Up a Reverse Proxy with nginx for the basic configuration, and Create an SSL Certificate to generate the certificate. The server block for the S3 API:

Code
server {
    listen 443 ssl;
    server_name s3.example.com;

    ssl_certificate /etc/letsencrypt/live/s3.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/s3.example.com/privkey.pem;

    client_max_body_size 0;
    proxy_request_buffering off;

    location / {
        proxy_pass http://127.0.0.1:3900;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

client_max_body_size 0 removes the upload size limit. proxy_set_header Host $host is important because S3 requests are signed with the hostname. Only expose the admin API (3903) to the internet if you need to access it remotely. For occasional administration, the garage commands over SSH are enough.

Back Up Your Data

Garage stores everything in /opt/garage/meta (metadata) and /opt/garage/data (data blocks). For a consistent copy, briefly stop Garage:

Code
cd /opt/garage
docker compose stop
tar czf /root/garage-backup-$(date +%F).tar.gz meta data garage.toml .env
docker compose start

The archive also contains the secrets from .env, so store it securely. For larger amounts of data, it’s better to back up to a second system with an S3-compatible tool such as rclone; see below.

Update Garage

Read the release notes before updating. Upgrading between major versions (for example, from 1.x to 2.x) requires a migration. Within a major version, update the version in docker-compose.yml and restart:

Code
cd /opt/garage
docker compose pull
docker compose up -d
docker exec garage /garage status

Create Buckets and Access Keys

It’s a good idea to create a separate bucket and key for each application or device. This way, a program can only read and write its own data. The following commands are for a manual installation with the garage container. For the One-Click App, replace garage after docker exec with the container name garage-CONTAINER.

Create a bucket:

Code
docker exec garage /garage bucket create backups

Create a key. The output displays the Key ID (access key) and Secret key. Save both in a secure place right away:

Code
docker exec garage /garage key create backup-key

Grant the key permissions for the bucket—in this example, read, write, and manage:

Code
docker exec garage /garage bucket allow --read --write --owner backups --key backup-key

Optionally, limit the bucket size so it doesn’t fill the entire disk:

Code
docker exec garage /garage bucket set-quotas backups --max-size 100GiB

Use garage bucket list, garage key list, and garage bucket info backups to check which buckets and keys exist and who has which permissions. You can display the secret key again with garage key info backup-key --show-secret.

Use Garage with rclone

rclone copies and synchronizes files between your computer, servers, and S3. Create a new remote with rclone config or add it directly to ~/.config/rclone/rclone.conf:

Code
[garage]
type = s3
provider = Other
endpoint = https://s3.example.com
region = garage
force_path_style = true
access_key_id = ACCESS_KEY
secret_access_key = SECRET_KEY

Then use the garage: remote:

Code
rclone lsd garage:
rclone copy /path/to/files garage:backups/server1
rclone ls garage:backups

rclone sync makes the destination match the source exactly, including deleting files from the bucket that no longer exist locally. Always test new commands with --dry-run first.

Connect Other S3 Programs

Every program with S3 support needs the same five details: endpoint, region garage, access key, secret key, and bucket, as well as path style. Examples:

  • AWS CLI: aws --endpoint-url https://s3.example.com s3 ls s3://backups; configure credentials with aws configure and set the region to garage.
  • restic: Repository s3:https://s3.example.com/backups; provide credentials through the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, then run restic init. restic encrypts the backup itself.
  • Duplicati: Choose “S3 Compatible” as the destination and enter the server and bucket. Duplicati is also available as a One-Click App.
  • Nextcloud: Use the “External storage support” app to connect a Garage bucket as external storage.

Use Garage as a Backup Target

Garage works well as a central destination for backups from other servers or your computers. Follow these rules to keep it secure:

  • Use one key per device. If a server is compromised, revoke only its key with garage key delete; all other backups remain accessible.
  • Encrypt on the client. Garage doesn’t encrypt objects itself. Tools such as restic, Duplicati, or rclone with the “crypt” backend encrypt data before it leaves the computer.
  • Set a quota. A quota for each bucket prevents a faulty backup from filling the disk and affecting all the other buckets.

Limitations of Single-Node Operation

  • No redundancy. On a single VPS, each object is stored exactly once (replication_factor = 1). Garage only creates multiple copies when you add more nodes; the documentation recommends three nodes in different locations. Keep a copy of important data on a second system—for example, use rclone sync to copy it to another server.
  • Not the full S3 feature set. Garage supports the features that backup tools and most applications need: buckets, multipart uploads, signed links, and basic lifecycle rules. Garage doesn’t support some Amazon S3 features, such as object versioning or Object Lock. See the list under S3 Compatibility.
  • No file management in a browser. You need an additional program to upload and share files through a web interface.

Conclusion

Garage gives you your own S3 storage on your VPS, which almost any backup tool and many applications can use directly. The fastest option is the One-Click App: the layout, first bucket, and access key are set up right away, and the S3 API is available over HTTPS. With a manual installation, you choose the configuration, domain, and ports yourself. In either case, a single server stores each object only once, so important data needs a second copy.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

The One-Click App is the quickest option: Garage starts in single-node mode, and the layout, first bucket, and access key are set up automatically. The S3 API is immediately available over HTTPS. Find the endpoint and keys under App environment in the app settings, and install updates from the dashboard. The manual Docker Compose installation is a good choice if you don’t use One-Click Apps, want to use a custom domain such as s3.example.com, or want to control the configuration and ports yourself.
Yes. Both are self-hosted, S3-compatible object storage solutions, and programs with S3 support can use either one. Garage is lightweight and designed to run across multiple locations, but it also works on a single VPS. There is no MinIO One-Click App. Before switching, check whether your application needs S3 features that Garage doesn’t support, such as object versioning.
Not with the One-Click App: it starts Garage with --single-node and sets up the layout for the single node automatically. The same applies to the manual installation in this guide. If you start Garage without this option, assign the layout with garage layout assign before creating the first bucket, then apply it with garage layout apply.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.