
SeaweedFS is an open-source, high-performance distributed storage system for blobs, objects, files, and S3-compatible access. It includes a master, a volume server, a filer, an S3-compatible API gateway, and an admin interface.
This article shows you how to deploy a single-node SeaweedFS with Traefik using Docker Compose. It also explains how to secure it with Let's Encrypt certificates, how to access it, and perform basic operations.
Before you begin, ensure you:
Have access to a Linux-based server as a non-root sudo user.
Install Docker and Docker Compose.
Register a domain and create two A records, both pointing to the server's IP address:
storage.example.com - SeaweedFS admin dashboard.s3.storage.example.com - S3-compatible API gateway.Install the AWS CLI on your local machine.
Set up a project directory to store your configuration files and generate authentication credentials.
Create and navigate to the project's folder.
Run the following command twice to generate access and secret keys for your S3 configuration.
Note the values to use in the later steps.
Create a .env file to store the deployment variables used by Docker Compose.
Add the following content. Replace storage.example.com with your admin subdomain, your-email@example.com with your email address for Let's Encrypt notifications, and yourpassword with a strong password for the admin dashboard.
Save and close the file.
Create ./s3-config.json to configure S3 authentication.
Add the following content. Replace YOUR_ACCESS_KEY and YOUR_SECRET_KEY with the values generated above.
Save and close the file.
Define your Docker Compose services with Traefik labels for automatic discovery and TLS.
Create the Docker Compose file.
Copy and paste the following configuration into the file.
Save and close the file.
Docker Compose reads the .env file automatically. The ${STORAGE_DOMAIN}, ${LETSENCRYPT_EMAIL}, and ${ADMIN_PASSWORD} placeholders are substituted with the values you set earlier. Traefik uses the labels to route:
storage.example.com to the SeaweedFS Admin UI.s3.storage.example.com to the S3 API endpoint.The configuration defines the following services:
traefik — reverse proxy that discovers services through Docker labels, obtains and renews Let's Encrypt certificates, and redirects HTTP traffic to HTTPS.master — centralized metadata coordinator. It manages cluster topology and volume locations. Data persists in ./master-data.volume — stores file chunks under instruction from the master. Data persists in ./volume-data.filer — provides a filesystem interface and integrates with the master and volume server.s3 — S3-compatible API gateway for programmatic object uploads and downloads.admin — web dashboard for browsing and managing uploaded files, protected by the password set in ADMIN_PASSWORD.Add the current user to the docker group so that you can run Docker commands without sudo.
Apply the group change to the current shell session.
Start the Docker Compose services in detached mode.
Verify that all services are running.
Test SeaweedFS functionality by uploading and downloading a file from your local terminal through the S3 API.
Configure the AWS CLI with your SeaweedFS S3 credentials. Run the following command and enter each value when prompted.
accessKey value from s3-config.json.secretKey value from s3-config.json.json.Create a bucket.
Upload a test file called test.txt.
Download the test file.
Verify the file contents.
The output displays the contents of the file.
Open https://storage.example.com in a web browser and log in with the username admin and the ADMIN_PASSWORD value that you set in the .env file.
Open the Buckets tab to view and manage available buckets.
In this tab, you can create a new bucket, delete a bucket, view a bucket's details, change bucket ownership, and set a bucket's storage quota.
Navigate into your test-bucket sample to view the contents inside.
In this tab, you can browse the contents of a bucket, download them, view them, delete them, check their properties, or create new folders.
You have successfully deployed SeaweedFS with Docker Compose and secured its public endpoints using Traefik and Let's Encrypt. The admin dashboard is accessible at https://storage.example.com and the S3-compatible API is available at https://s3.storage.example.com. For more information, refer to the official SeaweedFS documentation.
0 Comments
Be the first to comment and share your perspective with the community.