Object storage is a computer data storage that manages data as objects, as opposed to other storage architectures like file systems which manages data as a file hierarchy, and block storage which manages data as blocks within sectors and tracks.
Object storage is used for housing videos and photos, music, and files for online collaboration. In object storage, data is sectioned off into units (aka “objects”) where it is stored in a flat environment. Each object includes:
- Data
- Metadata
- Unique identifier
All data blocks for a file are contained together as an object and are stored in what is called a storage pool. To access data, the storage system uses a unique identifier and metadata to find the object. Data can be accessed using RESTful APIs, HTTP, and HTTPS.
Object storage is crucial to the functioning of cloud services and applications. And because of the way object storage works, you can scale very quickly, up to petabytes and exabytes (so long as the machine in question has the space).
MinIO is a high performance object storage solution that provides an Amazon Web Services S3-compatible API and supports all core S3 features. MinIO is built to deploy anywhere - public or private cloud, baremetal infrastructure, orchestrated environments, and edge infrastructure. It is a high performance distributed object storage server, designed for large-scale private cloud infrastructure. MinIO is designed in a cloud-native manner to scale sustainably in multi-tenant environments.
In this guide, we will explore how to deploy standalone minio server in docker and docker-compose.
Related content
- How to set up Minio as an Object Storage in Rocky Linux Server
- How to set CORS headers on your Amazon S3 bucket
- How to store Django Static and Media files in Amazon S3
- Script to Upload files to AWS S3 Using Golang
- Using AWS S3 Programatically with Python using Boto3 SDK
- Using AWS S3 from the terminal with awscli
Prerequisites
Before proceeding ensure that you have docker installed. Please checkout How to Install and Use Docker in Ubuntu 22.04 if you need help installing.
Start the container
Create a data directory
|
|
Run minio with docker
|
|
The above commands works this way:
mkdir
creates a new local directory at ~/minio/data in your home directory.docker run
starts the MinIO container.-p
binds a local port to a container port.-name
creates a name for the container.-v
sets a file path as a persistent volume location for the container to use. When MinIO writes data to/data
, that data mirrors to the local path~/minio/data
, allowing it to persist between container restarts. You can replace~/minio/data
with another local file location to which the user has read, write, and delete access.-e
sets the environment variablesMINIO_ROOT_USER
andMINIO_ROOT_PASSWORD
, respectively. These set the root user credentials. Change the example values to use for your container.
Runing MinIO using Docker Compose
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
Ensure you have docker-compose before proceeding. If you are on Linux, use this commane to set up
|
|
Confirm that it is working as expected by checking the version
|
|
Create a docker-compose.yaml file in your working directory.
|
|
Add this content:
|
|
Start the container
|
|
To confirm that it is working as expected, check docker-compose processes
|
|
Connect your Browser to the MinIO Server
Access the MinIO Console by going to a browser and going to http://127.0.0.1:9000 or one of the Console addresses specified in the minio server command’s output. For example, console: http://10.2.11.9:9090 http://127.0.0.1:9090 in the example output indicates two possible addresses to use for connecting to the Console.
While port 9000
is used for connecting to the API, MinIO automatically redirects browser access to the MinIO Console.
Log in to the Console with the credentials you defined in the MINIO_ROOT_USER
and MINIO_ROOT_PASSWORD
environment variables.
Install the MinIO Client
The MinIO Client allows you to work with your MinIO volume from the commandline.
Setting up in linux
Download the mc
client and install it to a location on your system PATH
such as /usr/local/bin
. You can alternatively run the binary from the download location.
|
|
Use mc
alias set to create a new alias associated to your local deployment. You can run mc
commands against this alias:
|
|
Replace {MINIO_ROOT_USER}
and {MINIO_ROOT_PASSWORD}
with the credentials you defined for the container with the -e
flags.
The mc
alias set takes four arguments:
- The name of the alias
- The hostname or IP address and port of the MinIO server
- The Access Key for a MinIO user
- The Secret Key for a MinIO user
Conclusion
You can use the MinIO Console for general administration tasks like Identity and Access Management, Metrics and Log Monitoring, or Server Configuration. Each MinIO server includes its own embedded MinIO Console.