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.
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 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.
- 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).
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search the app catalog for Garage and click Install on its card.
- Give the app a name under App name, for example
garage. - You don’t need to fill anything in under App configuration.
GARAGE_DEFAULT_BUCKETis the name of the first bucket; the default isdefault. Enter a custom name here if you already know what you want to call it, for examplebackups. Leave theGARAGE_S3_API_URL,GARAGE_WEB_URL, andGARAGE_ADMIN_URLfields empty; they’ll be populated during installation. - Under Automatically generated values, you can see which secrets the app will generate during installation. You don’t need to enter anything here.
- 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.
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:
- Click the gear icon on the app card and go to App environment.
- Under App configuration,
GARAGE_S3_API_URLcontains the S3 API address. This is the endpoint you enter in your programs. - Under Automatically generated values, find
SERVICE_HEX_32_GARAGEACCESSKEY(access key) andSERVICE_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:
| Setting | Value |
|---|---|
| Endpoint | Address from GARAGE_S3_API_URL |
| Region | garage |
| Access Key | SERVICE_HEX_32_GARAGEACCESSKEY |
| Secret Key | SERVICE_PASSWORD_64_GARAGE |
| Bucket | Value from GARAGE_DEFAULT_BUCKET (default default) |
| Addressing | 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.
The app provides three addresses over HTTPS. It doesn’t open ports on your VPS’s IP address:
GARAGE_S3_API_URLpoints to the S3 API (internal port3900). Without a valid access key, Garage responds with “Access Denied”; anonymous access is not available.GARAGE_ADMIN_URLpoints to the admin API (port3903). Apart from the/healthstatus page, it requires the token generated inSERVICE_PASSWORD_GARAGE.GARAGE_WEB_URLpoints to the web server for static websites hosted in buckets (port3902). Without a published bucket, it only displays “404 Not Found.”
The port for communication between Garage nodes (3901) remains inside the Docker network.
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:
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:
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.
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.
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.
- 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.
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2 GB |
| Storage | 20 GB | As 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.
The S3 API should only be accessible over HTTPS. Therefore, open only SSH and the ports for the reverse proxy:
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.
Create a directory and generate the secrets. The RPC secret must consist of 64 hexadecimal characters:
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:
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:
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 = 1stores each object once. This is the right setting for a single server.--single-nodeautomatically 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 assignandgarage layout apply; see the documentation).rpc_secret_file,admin_token_file, andmetrics_token_fileread the secrets from.env. Without an admin token, the admin API wouldn’t be usable.GARAGE_ALLOW_WORLD_READABLE_SECRETS=truedisables Garage’s check of file permissions for secrets, just as the One-Click App does. Protect the.envfile yourself withchmod 600.- Using
127.0.0.1inportsmakes the APIs accessible only to the reverse proxy on the same server. You only need port3901when you add more Garage nodes.
Start Garage:
docker compose up -d
Check that the node is running and the layout is set up:
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.
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:
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.
Garage stores everything in /opt/garage/meta (metadata) and /opt/garage/data (data blocks). For a consistent copy, briefly stop Garage:
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.
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:
cd /opt/garage
docker compose pull
docker compose up -d
docker exec garage /garage status
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:
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:
docker exec garage /garage key create backup-key
Grant the key permissions for the bucket—in this example, read, write, and manage:
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:
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.
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:
[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:
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.
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 withaws configureand set the region togarage. - restic: Repository
s3:https://s3.example.com/backups; provide credentials through theAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables, then runrestic 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.
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.
- 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, userclone syncto 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.
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.
