Host a Static Website with the Uplink CLI and Linksharing Service
You can use your own domain name and host your own static website on Storj DCS with the following setup.
Dynamic websites use server-side processing to generate the underlying code behind each page. They support Create, Read, Update, Delete operations against a database. Web views can be custom rendered to each user.
- Download the uplink binary () and upload your static site files to Storj DCS. You may also upload your files in any other manner, but you will need the Uplink CLI for the remaining steps.
- Share the bucket or object prefix (not individual objects) that will be the root of your website/subdomain. At the root, name your home pageindex.html. The website will serve the index.html file automatically e.g.http://www.example.test and http://www.example.test/index.htmlwill serve the same content. Anything shared with --dns will be readonly and available publicly (no secret key needed). You can optionally specify your preferred linkshare endpoint with --base-url
Notably, this mechanism allows you to host multiple websites from the same bucket by using different prefixes. You may also create multiple subdomains by using different hostnames (however, the Uplink CLI only generates info for one at a time).
The command above prints a zone file with the information needed to create 3 DNS records. Your CNAME should match the linkshare service domain (link.storjshare.io by default).
Remember to update the $ORIGIN from example.com to your domain name (keep the trailing .). You may also change the DNS $TTL.
For example, running
will output a zone file like the following:
1. In your DNS provider, create a CNAME record on your hostname using the CNAME from your generated zone file as the target name.
Ensure you include the trailing . at the end of your CNAME if your DNS providers allows.
2. Create 2 TXT records, prepending txt- to your hostname.
Root Path: the bucket or object prefix key that you want your root domain to resolve to (and that contains your index.html file).
Access Key: the readonly and public access key to your root path.
3. You can check to make sure your DNS records are ready with dig @18.104.22.168 txt-<hostname>.<domain> TXT
4. Without further action, your site will be served with HTTP. You can secure your site by using an HTTPS proxy server such as Fastly.
5. Optionally, if you create a page titled 404.htmlin the root of your shared prefix, it will be served in 404 conditions.
6. That's it! You should be all set to access your website! e.g.http://www.example.test