Using Sia as a Storage Back-End for Nextcloud


Nextcloud is a self-hosted alternative to dropbox: it provides a web interface for storing and retrieving your files, using several different storage backends. It integrates with AWS, Dropbox, and Google Cloud, so it was only natural that an integration with Sia was something we desired. This blog post acts as a walkthrough for people already running Nextcloud, guiding you through the process of using Sia with Nextcloud.
Setting up a Sia Node
Running Nextcloud with Sia requires running a full Sia node. This guide will walk you through the process of setting one up on your Nextcloud server, and assumes basic linux system administration knowledge.
Download the latest Sia release that supports Nextcloud, v1.1.2, available here. Unzip the release to your preferred installation directory, and start up a node by running siad. You may also want to set up siad as a service on your server.
Once you have started a siad instance, you should allow the blockchain to fully synchronize. This can take a fair bit of time, you can view the progress by running siac, the other binary packaged in the release.
After the blockchain has fully synced, create a new wallet by running siac wallet init. Make sure you keep the seed that is displayed after this command executes safe, it’s the passphrase you will use to unlock your wallet and can also be used to recover your wallet. Note that currently you cannot recover your files from this seed, though this is a planned feature. Now that you’ve initialized a wallet, run siac wallet unlock and provide your seed to unlock your wallet.
Now, you’ll want to acquire some Siacoin (SC). The usual process for this is to first get Bitcoin, then use an exchange (Yunbi, Poloniex, Shapeshift.io, and Bitsquare all have Siacoin) to convert from BTC to SC. Once you’ve done this, use siac wallet address to get an address you can receive coins on, and send your SC from your exchange to that address.
The final step is to set an allowance. A Sia allowance is a recurring amount that you allocate to file storage, download, and upload. You can use the siac renter setallowance command to set your allowance. It takes two parameters, amount and period, where amount is the amount of SC you will be setting aside and the period is the duration of the allowance. The allowance will automatically renew halfway through the period. After you set your allowance, you’re ready to install the Sia Nextcloud app and start uploading and downloading from the Nextcloud interface.
Setting up your Nextcloud installation
First, you’ll need to enable external storage on your Nextcloud installation, if you haven’t done so already. Nextcloud provides some good docs on how to do that here. After you’ve enabled external storages, you’ll need to install the Sia external storage app, available here. After you’ve installed the Sia app, add a new external storage from the external storage app. From the dropdown, select Sia. In the ‘API Address’ field, input the default api address, localhost:9980. Currently, the uploaded files must also be stored in a data directory on the server. Set the location by specifying it in the datadirfield. This requirement will be removed in an upcoming release. After setting both fields, you should see the status indicator turn to green, indicating that you’re ready to start uploading files to Sia.
Conclusion
The Nextcloud integration is one of the first major integrations of Sia into another storage product, we hope to be able to announce a few more in the coming months. You can check out the source code, report bugs, or request features for the Sia Nextcloud app on our github repo: https://github.com/NebulousLabs/Sia-Nextcloud. We’ll be constantly improving the core Sia product as well as the integrations, so you may want to follow the rest of our Github pages to stay in the loop.

Nextcloud has published a corresponding blog post here.