Skip to content

Object storage with S3 API

S3 API has become an industry standard for working with object storage. We offer a managed solution based on MinIO available at .s3-central.vshosting.cloud.

Create a new bucket

After activating the service, you will receive an access key and a secret key. You can use these to create one or several buckets for object storage. Use the s3cmd utility for this. After installing it, the program will create a new configuration in ~/.s3cfg. If the file does not exist, you can create it by calling s3cmd -configure. To use s3cmd our S3 API, you need to change the following lines in the ~/.s3cfg configuration file:

access_key = testuser
secret_key = password
host_base = <customer>.s3-central.vshosting.cloud
host_bucket = <customer>.s3-central.vshosting.cloud/%(bucket)
use_https = True

Afterwards, you can create a new bucket (called s3-drive in the example) with the following command:

s3cmd mb s3://s3-drive

Connecting from PHP

To connect from PHP, you can use the standard AWS SDK for PHP library - https://github.com/aws/aws-sdk-php.

It is important to change the host domain to .s3-central.vshosting.cloud and the following parameters in init:

$Connection = new AmazonS3(array(
    'key'=> testuser,
    'secret'=> password,
    'canonical_id'=> testuser,
    'canonical_name'=> testuser,
));