RustFS is open-source object storage that supports the Amazon Web Services S3 interface. This lets programs that can store files in Amazon S3 save them on your own server: backup tools like restic or rclone, web apps that offload uploads and images, or applications that require S3 storage. RustFS is written in Rust, runs as a single container, and comes with a web console where you can manage buckets, files, access keys, and users. It is considered a self-hosted alternative to MinIO.
In this guide, we’ll show you two ways to set it up: the easy way, as a One-Click App, where RustFS runs with a domain, HTTPS, and automatically generated credentials in just a few minutes; and the manual installation using Docker Compose in the console. After that, you’ll learn how to create buckets and access keys, secure the exposed port, and connect programs like the AWS CLI, rclone, and restic.
Your own S3 storage with RustFS is useful if:
- You want to send backups to an S3 target, for example with restic, rclone, or a backup plugin, and want the data to be stored on your own server.
- An application requires or offers S3, for example for uploads, media, or attachments, and you don’t want to use a cloud provider for it.
- You want to develop or test S3 applications without paying a cloud service per request or gigabyte.
- You want to share files between multiple servers or apps that all access the same S3 interface.
RustFS is less suitable as the only storage location for important data: the One-Click App runs on a single server with a single data directory, without a copy on other disks or servers. If the VPS goes down, the data is unavailable. That’s why you should also back up important data to a second location. And if you simply want to share files in a browser, a cloud solution like Nextcloud is a better fit.
With your VPS’s One-Click Apps, you can launch RustFS version 1.0.6. During installation, the app generates a random access key and a long, random password. The publicly known default credentials rustfsadmin do not work. Data is stored in a persistent volume on your VPS.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. For instructions, see VPS: One-Click Apps.
- At least 1 vCPU core, 512 MB RAM, and 2 GB of storage. We recommend 2 vCPU cores, 1 GB RAM, and 20 GB of storage. You’ll need storage primarily for your files, so plan according to the amount of data.
- Port
9000must not already be in use on the VPS, for example by another S3 or database app.
- Open your VPS in the ZapX dashboard and switch to the One-Click Apps tab.
- Search the App catalog for “RustFS” and click Install app next to RustFS.
- Under App name, you can enter a name of your choice, such as “RustFS Backups.”
- Leave Use a custom subdomain or zap.cloud enabled and choose a subdomain. You’ll use this address later to access the console and the S3 interface over HTTPS.
- You don’t need to enter anything under App configuration. The app generates both credentials itself.
- Click Queue installation. After about a minute, the app will show as Online.
The web console isn’t available directly at the app’s address. It’s at the /rustfs/console/ path. Open it like this:
https://app.example.com/rustfs/console/
Replace app.example.com with your app’s address. You can find it on the app card, but the Access link there points to the base address without a path.
The S3 interface, not the console, responds at the base address. Without signing in, it displays a short XML message with AccessDenied. This is not an error. Add /rustfs/console/ to the address.
Sign in using the Key Login tab. You’ll find the credentials in the app settings (gear icon) under App environment > Automatically generated values:
| Field in the console | Value from the app environment |
|---|---|
| Account | SERVICE_USER_RUSTFS, the main account’s access key |
| Key | SERVICE_PASSWORD_RUSTFS, the associated 32-character password |
Click the eye icon to reveal a value, or the copy icon to copy it. This main account has full permissions. Use it to manage the console, and create separate access keys for programs.
A bucket is a storage area for files, similar to a top-level folder. Programs always write to a bucket.
- In the console, open Browser on the left.
- Click Create Bucket, enter a name such as
backups, and confirm.
Bucket names can contain lowercase letters, numbers, and hyphens. New buckets are private: no one can access the files without an access key. The list shows the number of objects and storage used for each bucket. Click a name to upload or download files.
Give a backup tool or app its own access key instead of the main account credentials. That way, you can revoke or delete the key independently later.
- In the console, open Access Keys on the left and click Add Access Key.
- RustFS suggests random Access Key and Secret Key values. Under Name, enter what the key is for, such as
restic-backup. An expiration date under Expiry is optional. - If Use main account policy is enabled, the key has the same permissions as the main account. Turn it off to restrict the permissions.
- Click Submit and copy both values, or download them using Download.
After you close the window, RustFS will no longer show the Secret Key. Save it to your password manager right away. If you lose it, create a new key and delete the old one.
If you need separate accounts with specific permissions, create users with their own passwords under Users and assign them a Policy. The predefined policies include readonly (read-only), writeonly (write-only), and readwrite (read and write). Create custom policies, for example for a single bucket, under Policies.
Programs need four values: the address (endpoint), the Access Key, the Secret Key, and a region. The One-Click App is available at two addresses:
| Endpoint | Connection | Use |
|---|---|---|
https://app.example.com | HTTPS via the app’s domain | For all programs; recommended |
http://SERVER_IP:9000 | Unencrypted via the IP address | Only for programs without HTTPS support or on the same VPS |
Both addresses access the same buckets. Enter us-east-1 as the region; RustFS also accepts other values. The addressing style matters: set the program to Path-Style (bucket in the path, for example https://app.example.com/backups). Virtual-host style, with the bucket as a subdomain (backups.app.example.com), won’t work because there are no DNS records for it.
The app also exposes the S3 interface on port 9000 on all of your VPS’s addresses, without encryption. No one can access your files without a valid access key, but content sent this way travels over the internet unencrypted. Use the HTTPS address for external access and block port 9000 if you don’t need it.
The firewall on the VPS itself (ufw) won’t help here: ports published by Docker remain accessible even if ufw blocks them. Instead, use the Network firewall in the ZapX dashboard. It filters traffic before it reaches your VPS:
- Open your VPS in the ZapX dashboard and switch to the Network firewall tab. Check that Firewall active is enabled.
- Click Add rule. Set Direction to
IN, Action toDROP, and Service template to Custom. Set Protocol totcpand Destination port to9000. Leave Source empty and click Create. - If a specific server needs to access port 9000, create a rule for its IP address with Action set to
ACCEPT. Under Custom rules, use the arrows to move it above theDROPrule. The first matching rule takes precedence.
The console and HTTPS address use port 443 and remain accessible. Connections from apps on the same VPS don’t pass through the Network Firewall and will continue to work. For more about ports and firewalls, see VPS: Open Ports and Manage the Firewall on Linux.
- Updates: Open the app settings (gear icon) > App update and click Check for updates. If a new app version is available, install it using Apply update. Your buckets and files will be preserved.
- Back up: A VPS backup from the Backups tab includes the data volume. You can also copy individual buckets to a second location with rclone, as described under “Back up Data.”
- Uninstall: Under App actions > Uninstall app, you can also delete the data volume. This permanently deletes all buckets and files. Back them up first.
The rest of this guide covers the manual installation of RustFS using Docker Compose in the console, for example on a server without One-Click Apps. The commands are written for Debian and Ubuntu. Unlike the One-Click App, RustFS initially listens only on the server itself.
| Minimum | Recommended | |
|---|---|---|
| CPU | 1 vCPU core | 2 vCPU cores |
| RAM | 512 MB | 1 GB |
| Storage | 2 GB free (image is just under 500 MB) | 20 GB or more, depending on the amount of data |
You’ll also need Docker with the Compose plugin, as described in How to Set Up Docker on a Linux Server, and SSH access; see VPS: First Access via SSH. To access RustFS over HTTPS, you’ll also need a domain or subdomain pointing to your server.
In this guide, RustFS is bound only to 127.0.0.1 and doesn’t need its own open port. Open SSH, as well as HTTP and HTTPS for the reverse proxy, in ufw:
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Ports published by Docker on all addresses using ports: are accessible from outside even if ufw blocks them. So leave 127.0.0.1: in front of the ports in the Compose file.
Create a folder and add a .env file containing random credentials:
sudo mkdir -p /opt/rustfs
cd /opt/rustfs
echo "RUSTFS_ACCESS_KEY=admin-$(openssl rand -hex 4)" | sudo tee .env > /dev/null
echo "RUSTFS_SECRET_KEY=$(openssl rand -hex 24)" | sudo tee -a .env > /dev/null
sudo chmod 600 .env
sudo cat .env
sudo nano compose.yaml
Make a note of the two values displayed by cat. You’ll use them to sign in to the console later. Add the following content to compose.yaml:
services:
rustfs:
image: rustfs/rustfs:1.0.6
container_name: rustfs
restart: unless-stopped
security_opt:
- "no-new-privileges:true"
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
environment:
RUSTFS_VOLUMES: /data/rustfs0
RUSTFS_ADDRESS: 0.0.0.0:9000
RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_ACCESS_KEY: ${RUSTFS_ACCESS_KEY}
RUSTFS_SECRET_KEY: ${RUSTFS_SECRET_KEY}
volumes:
- rustfs-data:/data
healthcheck:
test: ["CMD", "sh", "-c", "curl -fsS http://127.0.0.1:9000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
rustfs-data:
The important lines:
image: rustfs/rustfs:1.0.6is the same version as the One-Click App. The fixed version number prevents an unexpected new version from being downloaded when you restart.RUSTFS_ACCESS_KEYandRUSTFS_SECRET_KEYset the main account credentials. They come from.env. Without these lines, RustFS starts with the publicly known default valuesrustfsadmin, so never leave them out.RUSTFS_ADDRESSis the S3 interface on port 9000;RUSTFS_CONSOLE_ADDRESSis the console on port 9001.RUSTFS_CONSOLE_ENABLEenables the console.127.0.0.1:9000and127.0.0.1:9001make both ports accessible only on the server itself.RUSTFS_VOLUMESsets the data directory inside the container. It’s stored in therustfs-datavolume and contains all buckets, files, users, and access keys.
Start RustFS and check its status:
sudo docker compose up -d
sudo docker compose ps
curl http://127.0.0.1:9000/health
After about a minute, the STATUS column will show healthy. The curl command returns "status":"ok" and the version.
Until a reverse proxy is running, open the console through an SSH tunnel. Run this command on your PC and leave the window open:
ssh -L 9001:127.0.0.1:9001 root@SERVER_IP
Then open http://localhost:9001/rustfs/console/ in your browser and sign in with the values from .env: enter RUSTFS_ACCESS_KEY in the Account field and RUSTFS_SECRET_KEY in the Key field. Create buckets and access keys in the same way as described for the One-Click App.
To let programs connect securely from outside, use nginx to forward a subdomain such as s3.example.com to RustFS. Port 9001 serves the console at /rustfs/console/ and also handles S3 requests on all other paths. The One-Click App works the same way, so one subdomain is enough for both:
server {
listen 80;
server_name s3.example.com;
client_max_body_size 0;
proxy_request_buffering off;
location / {
proxy_pass http://127.0.0.1:9001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_read_timeout 300s;
}
}
client_max_body_size 0 removes the upload size limit, while proxy_request_buffering off streams large files directly instead of temporarily storing them on the proxy’s disk. Host $host is important because S3 requests are signed using the hostname. For instructions on setting up nginx and issuing a certificate, see VPS: Set Up a Reverse Proxy with nginx on Linux and VPS: Create an SSL Certificate (Let's Encrypt) for Linux Servers. Afterward, you can access the console at https://s3.example.com/rustfs/console/; programs use https://s3.example.com as the endpoint.
All data is stored in the rustfs_rustfs-data volume. The name is made up of the folder name and the volume name. To create a full backup, briefly stop RustFS and archive the volume:
cd /opt/rustfs
sudo docker compose stop
sudo mkdir -p /root/backups
sudo docker run --rm -v rustfs_rustfs-data:/data:ro -v /root/backups:/backup alpine tar czf /backup/rustfs-$(date +%F).tar.gz -C /data .
sudo docker compose start
You can back up individual buckets while RustFS is running with rclone, for example to another server or a second S3 storage location. For instructions on connecting rclone, see “Connect Programs to RustFS” below. Download backups from the server regularly, for example via SFTP. A backup stored only on the same server won’t help if a disk fails.
Enter the new version number for image in compose.yaml and restart:
cd /opt/rustfs
sudo nano compose.yaml
sudo docker compose pull
sudo docker compose up -d
RustFS releases new versions frequently. Before updating, read the release notes on GitHub and create a backup.
These examples work the same way with the One-Click App and the manual installation. Replace https://s3.example.com with your HTTPS address and use an access key you created in the console.
Configure the AWS CLI once with your access key, then specify the endpoint with each command:
aws configure set aws_access_key_id ACCESS_KEY
aws configure set aws_secret_access_key SECRET_KEY
aws configure set region us-east-1
aws configure set default.s3.addressing_style path
aws --endpoint-url https://s3.example.com s3 ls
aws --endpoint-url https://s3.example.com s3 cp datei.zip s3://backups/
rclone is useful for uploading, syncing, and backing up entire folders. Add an entry for RustFS to ~/.config/rclone/rclone.conf:
[rustfs]
type = s3
provider = Other
access_key_id = ACCESS_KEY
secret_access_key = SECRET_KEY
endpoint = https://s3.example.com
region = us-east-1
force_path_style = true
Use rclone lsd rustfs: to see your buckets. Use rclone sync /var/www/uploads rustfs:backups/uploads to mirror a folder to the bucket. To back up a bucket to another server’s disk, run rclone sync rustfs:backups /root/backups/s3.
restic stores encrypted, versioned backups in a bucket. Pass the credentials as environment variables:
export AWS_ACCESS_KEY_ID=ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=SECRET_KEY
restic -r s3:https://s3.example.com/backups -o s3.bucket-lookup=path init
restic -r s3:https://s3.example.com/backups -o s3.bucket-lookup=path backup /etc /var/www
init creates the repository once and prompts you for an encryption password. Without this password, you won’t be able to access your backups, so keep it safe. Use restic snapshots to list existing backups and restic restore latest --target /root/restore to restore the latest one.
- One server, one disk: The One-Click App stores everything in a single data directory, without a copy on other disks or servers. Important data needs a second backup in another location.
- Path-Style only: Addresses with the bucket as a subdomain won’t work. Set Path-Style in each program.
- The console isn’t at the base address: The console is always at
/rustfs/console/; the base address is for the S3 interface. - Port 9000 is unencrypted: For internet access, use the HTTPS address and block port 9000 in the Network Firewall.
With RustFS, you now have your own secured S3 storage with buckets and access keys that you can use with the AWS CLI, rclone, or restic for backups and apps. Next, Set Up Backrest on a Linux Server shows you how to schedule encrypted restic backups in your browser and store them directly in RustFS.
If you have any other questions or need help, our support team is available every day! 🙂
