Logo
← Back to blog

How to connect Vultr Object Storage to file.rocks

Cover image

Vultr 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 Vultr bucket, and file.rocks gives you a place to browse and upload them.

You need a hostname, an Access Key and a Secret Key from Vultr. You'll also add one CORS rule from the terminal so uploads from your browser go through. We'll walk through each part.

1. What you need

  • Your Access Key
  • Your Secret Key
  • Your hostname, like ewr1.vultrobjects.com
  • Your bucket name

2. Create a subscription and a bucket

If you don't have Object Storage yet, log in to the Vultr Console. Go to Products and click Cloud Storage. Select Object Storage, then click Create Object Storage.

Pick a tier, enter a name in the Name field, and select a location. Then click Create Object Storage again to set it up.

Next, make a bucket. Open your new subscription, go to Buckets and click Create Bucket. Enter a name, turn Bucket Versioning and object lock on or off, and click Create Bucket.

3. Find your S3 credentials

In the Vultr Console, go to Products, then Cloud Storage. Click Object Storage and select your subscription.

Select Overview and go to S3 Credentials. Your hostname, Access Key and Secret Key are all there. If you need a fresh set, click Regenerate Keys on the same screen.

4. Pick your hostname

Each Vultr location has its own hostname. Here's the list from Vultr's FAQ:

  • Amsterdam: ams1.vultrobjects.com, ams2.vultrobjects.com
  • Atlanta: atl1.vultrobjects.com, atl2.vultrobjects.com
  • Bangalore: blr1.vultrobjects.com, blr2.vultrobjects.com
  • Chicago: chi3.vultrobjects.com
  • London: lhr1.vultrobjects.com
  • Los Angeles: lax1.vultrobjects.com
  • New Delhi: del1.vultrobjects.com
  • New Jersey: ewr1.vultrobjects.com, ewr2.vultrobjects.com
  • Seattle: sea1.vultrobjects.com
  • Silicon Valley: sjc1.vultrobjects.com
  • Singapore: sgp1.vultrobjects.com, sgp2.vultrobjects.com
  • Sydney: syd1.vultrobjects.com
  • Tokyo: nrt1.vultrobjects.com

Use the one shown on your Overview page. In file.rocks, put https:// in front of it and leave the bucket name out.

5. 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.

6. Fill in the details

Access Key ID is your Vultr Access Key, and Secret Access Key is your Secret Key from step 3.

Endpoint is your hostname with https:// in front, like https://ewr1.vultrobjects.com.

Bucket Name is just the name of your bucket.

For Region, type US. Vultr's s3cmd guide uses US as the default region and says Vultr ignores this value. If file.rocks puts in something different after you leave the Endpoint or Bucket Name box, change it back to US.

Nickname (optional) is the name you'll see in file.rocks, like "Vultr New Jersey".

7. 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 location code in the Endpoint, like ewr1
  • The Bucket Name

8. 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. Your bucket needs a CORS rule that allows this, or the upload fails. Vultr is S3-compatible, so you can set one with the AWS CLI.

9. Add a CORS rule from the terminal

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 US. For the output format, type json.

aws configure --profile vultr

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 own hostname in place of the New Jersey one if yours is different.

aws s3api put-bucket-cors --bucket your-bucket --cors-configuration file://file-rocks-cors.json --endpoint-url https://ewr1.vultrobjects.com --profile vultr

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://ewr1.vultrobjects.com --profile vultr

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

If you already use s3cmd, its setcors command works too.

For more on uploading, see how to upload files to your own bucket. To send a file to someone, see how to share a file from your own bucket. The Contabo guide, the IDrive e2 guide and the DigitalOcean Spaces 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 Vultr Object Storage to file.rocks | file.rocks Blog