This guide explains how to deploy Minio, an object storage server compatible with Amazon S3, on a Dokku host. Dokku is a lightweight PaaS that simplifies deploying and managing applications using Docker.
Before proceeding, ensure you have the following:
- A working Dokku host.
- (Optional) The Let's Encrypt plugin for SSL certificates.
Log into your Dokku host and create the minio
app:
dokku apps:create minio
Minio requires a root username and password for authentication. Set these environment variables:
dokku config:set minio MINIO_ROOT_USER=<username>
dokku config:set minio MINIO_ROOT_PASSWORD=<password>
To persist uploaded data between restarts, create a folder on the host machine and mount it to the app container:
dokku storage:ensure-directory minio --chown false
dokku storage:mount minio /var/lib/dokku/data/storage/minio:/data
Set the domain for your app to enable routing:
dokku domains:set minio minio.example.com
Map the internal port 9000
to the external port 80
:
dokku ports:set grafana http:80:9000
To allow larger file uploads, adjust the CLIENT_MAX_BODY_SIZE
environment variable. For example, to set a 10MB limit:
dokku config:set minio CLIENT_MAX_BODY_SIZE=10M
You can deploy the app to your Dokku server using one of the following methods:
If your repository is hosted on a remote Git server with an HTTPS URL, you can deploy the app directly to your Dokku server using dokku git:sync
. This method also triggers a build process automatically. Run the following command:
dokku git:sync --build minio https://github.com/d1ceward-on-dokku/minio_on_dokku.git
If you prefer to work with the repository locally, you can clone it to your machine and push it to your Dokku server manually:
-
Clone the repository:
# Via SSH git clone [email protected]:d1ceward-on-dokku/minio_on_dokku.git # Via HTTPS git clone https://github.com/d1ceward-on-dokku/minio_on_dokku.git
-
Add your Dokku server as a Git remote:
git remote add dokku [email protected]:minio
-
Push the app to your Dokku server:
git push dokku master
Choose the method that best suits your workflow.
Secure your app with an SSL certificate from Let's Encrypt:
-
Add the HTTPS port:
dokku ports:add grafana https:443:9000
-
Install the Let's Encrypt plugin:
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
-
Set the contact email for Let's Encrypt:
dokku letsencrypt:set minio email [email protected]
-
Enable Let's Encrypt for the app:
dokku letsencrypt:enable minio
To access the Minio web console, configure the necessary proxy settings:
# If SSL is enabled
dokku ports:add minio https:<desired_port>:9001
# If SSL is disabled
dokku ports:add minio http:<desired_port>:9001
Replace <desired_port>
with your preferred port number (default is 9001
).
To fix share links generated by the console pointing to the Docker container IP instead of your domain, set the following environment variables:
dokku config:set minio \
MINIO_SERVER_URL=https://minio.example.com \
MINIO_BROWSER_REDIRECT_URL=https://minio.example.com:9001
Congratulations! Your Minio instance is now up and running. You can access it at https://minio.example.com.
Happy file management!