Logo
← Back to blog

How to connect Contabo Object Storage to file.rocks

Cover image

Contabo Object Storage works with the same API as Amazon S3, so file.rocks connects to it with the Other S3-compatible option. Your files stay in your Contabo bucket, and file.rocks gives you a place to browse and upload them.

You need three things from Contabo: your endpoint, your Access Key, and your Secret Key. If uploads from your browser fail later, you'll also add a CORS rule. We'll cover that too.

1. Find your endpoint

Contabo has one endpoint for each region:

  • European Union: https://eu2.contabostorage.com
  • United States: https://usc1.contabostorage.com
  • Singapore: https://sin1.contabostorage.com

Use the one that matches the region of your Object Storage. Paste only that address, without the bucket name in it.

2. Find your S3 keys

Log in to the Contabo Customer Panel. Click Account in the left menu, then select Security & Access. Scroll down to S3 Object Storage Credentials.

Your Access Key and Secret Key are shown there. You can make a new Secret Key on the same screen if you need one.

3. Open the bucket form

In file.rocks, go to Settings, then Buckets, and click Add Bucket. If you don't have any buckets yet, the button reads Create your first bucket.

The Create Bucket window opens. Under Storage Type, pick Bring Your Own. Then open Provider and choose Other S3-compatible.

4. Fill in the details

Access Key ID is your Contabo Access Key, and Secret Access Key is your Secret Key from step 2.

Endpoint is the address from step 1, starting with https://.

Bucket Name is just the name of your bucket.

For Region, type default. Contabo's help says you may use default as the S3 region. If file.rocks puts in something different after you leave the Endpoint or Bucket Name box, change it back.

Nickname (optional) is the name you'll see in file.rocks, like "Contabo EU".

5. Save, then check Files

Click Save Bucket. file.rocks doesn't test an S3-compatible connection when you save, so the bucket saves even if a detail is wrong.

Open Files to check. If the files in your bucket show up, your keys, endpoint and bucket name are right.

If nothing loads, look at these again:

  • The Access Key ID and Secret Access Key
  • The region in the Endpoint
  • The Bucket Name

6. Upload a test file

Drop a small file into Files and see if it lands.

When you upload in file.rocks, the file goes straight from your browser to your bucket. If your files list fine but uploads fail, your bucket probably needs a CORS rule that allows it. Contabo is S3-compatible, so you can set one with the AWS CLI.

7. If uploads fail, add a CORS rule

Set up the AWS CLI

Install the AWS CLI using Amazon's install guide. Then open a terminal. On a Mac that's the Terminal app, on Windows it's PowerShell, and on Linux it's whatever terminal you normally use.

Run this and paste your Access Key and Secret Key when it asks. For the region, type default. For the output format, type json.

aws configure --profile contabo

Then tell the CLI to put the bucket name in the path, which is how Contabo expects it:

aws configure set s3.addressing_style path --profile contabo

Write the CORS rule

Make a file called file-rocks-cors.json with this in it:

{
  "CORSRules": [
    {
      "AllowedOrigins": ["https://www.file.rocks"],
      "AllowedMethods": ["PUT", "GET", "HEAD"],
      "AllowedHeaders": ["Content-Type"]
    }
  ]
}

This rule only allows what file.rocks needs. PUT is the important one, because that's how your browser sends the file.

Apply it and check it

In the same folder as the file, run this. Put your bucket's name in place of your-bucket, and your endpoint from step 1 in place of the EU one if yours is different.

aws s3api put-bucket-cors --bucket your-bucket --cors-configuration file://file-rocks-cors.json --endpoint-url https://eu2.contabostorage.com --profile contabo

If it worked, it prints nothing. That's normal. Now read the rule back:

aws s3api get-bucket-cors --bucket your-bucket --endpoint-url https://eu2.contabostorage.com --profile contabo

You should see your origin, the three methods, and Content-Type. Then try your test upload again.

For more on uploading, see how to upload files to your own bucket. The Scaleway guide, the Hetzner guide, the DigitalOcean Spaces guide and the MinIO guide walk through other Other S3-compatible setups. If you're still choosing a provider, cheapest cloud object storage compares the options.

Your files stay in the bucket you connected, and file.rocks is how you manage them.

How to connect Contabo Object Storage to file.rocks | file.rocks Blog