Skip to main content

JuiceFS S3 Gateway

From 4.9 and above, JuiceFS Client provides the juicefs gateway subcommand to enable an S3 compatible RESTful APIs for file system access. Currently clients like s3cmd, AWS CLI and MinIO Client and S3 SDK for various programming languages are supported for accessing JuiceFS.

Before deploying the S3 gateway, you need to authenticate against the Web Console using the auth command, this command will fetch the configuration file.

set credentials

S3 gateway is implemented using the open source MinIO code, so you'll have to provide some MinIO related variables:

export MINIO_ACCESS_KEY="admin"
export MINIO_SECRET_KEY="password"

Forgetting these variables will result in errors like MINIO_ROOT_USER should be specified as an environment variable with at least 3 characters`.

launch S3 gateway

juicefs gateway myjfs

Expect the following output:

2023/03/21 20:15:49.945403 juicefs[97188] <INFO>: connected to [client.go:874]
2023/03/21 20:15:49.965411 juicefs[97188] <INFO>: Cache: /Users/herald/.juicefs/cache/jfs8 capacity: 102400 MB [disk_cache.go:747]

Browser Access:

Object API (Amazon S3 compatible):

Assuming your server's public IP being and you want to open up access to the gateway over the internet and bind to port 9000, you can adjust the startup command like this:

juicefs gateway myjfs

Access Gateway

Once S3 Gateway is launched, you can directly access the URL you set in your browser, i.e., in the example above. Open the file explorer for web, and enter the corresponding Access Key and Secret Key to login.

In addition, clients like AWS CLI and MinIO Client and S3 SDKs for various programming languages are also available for accessing S3 Gateway.