# Config custom domain with Linode object storage

You can use your own domain for your Linode object storage:

### Step 1

Create a bucket, make sure your label is the same as the domain you are going to bind. For example, if you want to access your files under https://s3.example.org, then in the label, you should put `s3.example.org`.


![Screen Shot 2021-07-23 at 16.01.59.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627070526719/TOZV8GqMz.png)

### Step 2

Now you have your bucket, now you just need to put your own domain's SSL certificate. Click your bucket, then go to the "SSL/TLS" tab:


![Screen Shot 2021-07-23 at 16.03.37.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627070626975/gAuAMkZeN.png)

Then copy your cert and key file's content into those 2 boxes.

If you don't have SSL cert yet, you can use the [acme.sh](https://github.com/acmesh-official/acme.sh) tool to generate one. Once generated, you can put the `fullchain.cer` content into the "Certificate" field, and put the `s3.example.org.key` content into the "Private Key" field.

Now you are all set, upload some file, your file url by default will be under linode's domain, like "https://s3.example.org.us-east-1.linodeobjects.com/test.jpg" . The page may show "Your connection is not private", because Linode only SSL cert for *.us-east-1.linodeobjects.com, but not sub sub domain.

So 2 ways to access your file:
*  Change the protocol to http:// to view the file, or
*  View the file under your own domain, like "https://s3.example.org/test.jpg"

### How to auto renew cert

Since the cert you put usually have an expire date, if you want to auto renew the cert, you could use [acme.sh](https://github.com/acmesh-official/acme.sh) + [Linode Object Storage API](https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-upload), for example, every time when acme.sh finished a renewal, you could call Linode's API to auto delete the current one then upload the new one.

### Reference

* [Linode - enable ssl for object storage](https://www.linode.com/docs/guides/enable-ssl-for-object-storage/#before-you-begin)
* [acme.sh with dns](https://github.com/acmesh-official/acme.sh/wiki/dnsapi)
* [Linode object storage SSL API](https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-upload)

