Minio is an object storage server that is API compatible with the Amazon S3 cloud storage service. You can find more information about Minio on the minio.io website.
Dokku is a lightweight implementation of a Platform as a Service (PaaS) that is powered by Docker. It can be thought of as a mini-Heroku.
- A working Dokku host
- Letsencrypt plugin for SSL (optionnal)
Note: Throughout this guide, we will use the domain minio.example.com
for demonstration purposes. Make sure to replace it with your actual domain name.
Log into your Dokku host and create the Minio app:
dokku apps:create minio
Minio uses a username/password combination (MINIO_ROOT_USER
and MINIO_ROOT_PASSWORD
) for authentication and object management. Set these environment variables using the following commands:
dokku config:set minio MINIO_ROOT_USER=<username>
dokku config:set minio MINIO_ROOT_PASSWORD=<password>
To modify the upload limit, you need to adjust the CLIENT_MAX_BODY_SIZE
environment variable used by Dokku. In this example, we set it to a maximum value of 10MB:
dokku config:set minio CLIENT_MAX_BODY_SIZE=10M
To ensure that uploaded data persists between restarts, we create a folder on the host machine, grant write permissions to the user defined in the Dockerfile, and instruct Dokku to mount it to the app container. Follow these steps:
dokku storage:ensure-directory minio --chown false
dokku storage:mount minio /var/lib/dokku/data/storage/minio:/data
To enable routing for the Minio app, we need to configure the domain. Execute the following command:
dokku domains:set minio minio.example.com
Begin by cloning this repository onto your local machine.
git clone [email protected]:d1ceward/minio_on_dokku.git
git clone https://github.com/d1ceward/minio_on_dokku.git
Now, set up your Dokku server as a remote repository.
git remote add dokku [email protected]:minio
Now, you can push the Minio app to Dokku. Ensure you have completed this step before moving on to the next section.
git push dokku master
Lastly, let's obtain an SSL certificate from Let's Encrypt.
# Install letsencrypt plugin
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
# Set certificate contact email
dokku letsencrypt:set minio email [email protected]
# Generate certificate
dokku letsencrypt:enable minio
Congratulations! Your Minio instance is now up and running, and you can access it at https://minio.example.com.
To access the Minio web console and manage your files, you need to configure the necessary proxy settings. The following commands will help you set it up:
# If ssl enabled
dokku proxy:ports-add minio https:<desired_port>:9001
# If ssl disabled (note scheme change)
dokku proxy:ports-add minio http:<desired_port>:9001
Replace <desired_port>
with the port number you prefer. By default, Minio uses port 9001
.
After setting up the proxy, you can access the Minio web console by visiting https://minio.example.com:9001 in your web browser.
To resolve an issue with share links generated by the console pointing to the Docker container IP instead of your Minio instance, you can use the following command:
dokku config:set minio \
MINIO_SERVER_URL=https://minio.example.com \
MINIO_BROWSER_REDIRECT_URL=https://minio.example.com:9001
This command sets the appropriate environment variables to ensure that share links correctly point to your Minio instance at https://minio.example.com and utilize the configured port.
Now you're all set to use Minio and leverage its powerful features for your storage needs. Happy file management!