Skip to main content

Deploy s3gw in Digital Ocean

· 4 min read


In this tutorial, we will walk through the setup of a single-node K3s Kubernetes cluster with Rancher, together with the S3 Gateway (s3gw) and a Longhorn PV (Persistent Volume). This guide will use Digital Ocean, but these instructions will likely work with other cloud providers as well. 


Before you begin, if you have not heard yet of the s3gw project, read this article first. The s3gw is a lightweight S3 service for Kubernetes users running on top of a Longhorn PV (and it comes with a nice user interface).

For the purpose of this article, there is assumed knowledge of K3sRancher and Longhorn.  However, if you need more information, you will find plenty of useful information in this blog.


You will need to have created a Droplet in Digital Ocean. For this specific tutorial, you will need the following: 

  • OS: Ubuntu 20.04 (LTS) x64 
  • CPU Options: Regular Intel with SSD + 8 GB / 4 CPUs  
  • Add block storage: Leave as it is 
  • Datacenter region: Choose the datacenter region closer to you 
  • VPC Network: Leave as it is 
  • Authentication: via SSH, click the "new SSH Key", follow the instructions given (identify your ssh key properly) and after it is added, select it with the appropriate checkbox. 
  • Additional Options: Leave as it is 
  • Finalize and create: identify your droplet with a hostname (ex: <your name>-local-rancher).
  • Hit Create Droplet 

And there you go! You have a system ready to hack on!

Prepare your system 

Now we need to set up your droplet. Install Helm:

$ ssh root@IP-ADDRESS
$ apt-get install open-iscsi
$ snap install --classic helm

1. Install K3s 

Now, set up K3s: 

$ curl -sfL []( | INSTALL_K3S_VERSION="v1.24.7+k3s1" sh -s - server --cluster-init 
$ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml  

2. Define a Kubernetes namespace 

Now, we need to define a Kubernetes namespace where the resources created by the chart should be installed: 

$ kubectl create namespace cattle-system 

3. Set up certificate management 

Next, set up cert-manager: 

$ kubectl apply -f <> 

$ helm repo add jetstack [](
$ helm repo update
$ helm install cert-manager jetstack/cert-manager\
  --namespace cert-manager\
  --version v1.7.1 

4. Install Rancher server 

Once you are done installing K3s, install Rancher through the helm chart: 

$ helm repo add rancher-latest <> 

$ helm install rancher rancher-latest/rancher\
  --namespace cattle-system\
  --set hostname= IP-ADDRESS[](\
  --set replicas=1\
  --set bootstrapPassword=PASSWORD 

We are using as the DNS service. The installation will take some time. Then you will be ready to access Rancher: 

Rancher login page

5. Retrieve the password 

Retrieve your password by running the following command: 

$ kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{ .data.bootstrapPassword|base64decode}}{{ "\n" }}'

Install s3gw using the Rancher UI

The s3gw can be found in the Rancher UI as a partner chart: 

To access, go to "Apps" and then "Charts". Choose the partner charts drop-down and click on the s3gw partner chart: 

Rancher partner charts

Click  "Install" and tick the "Customize Helm options before install": 


Here are the remaining three steps: 

  1. Set App Metadata: Select the project to install s3gw into. 
  2. Values: Here, you can set up access and secret keys, storage, etc. The chart sets up a Longhorn volume by default.  Update are the hostnames for the S3 service and the UI: 

s3gw installation values

3. Finally, there are other options you can also set up additional deployment options:

Helm options

And that's it! You can now access the s3gw UI in :

s3gw login

⚠️ "Network failure" issue.

When you try to log into the UI for the first time, you will find a "Network Failure" error. This is a known issue

To work around this issue, access the S3 service URL first ( You will then be able to log into the UI:


Call to action

We would love to hear from you about what you'd like to see on our roadmap. What would enable you best to use s3gw in your environment? 

Reach out to us at or our Slack channel. You can also join our mailing list or have a look at our GitHub repository -- feature requests are welcome! 🙂