Nextcloud with Storj as Primary Storage

I won’t go in to the details of the storj infrastructure and how it all works, you can read it over at the storj documentations or wait for another post here.

The tardigrade.io documentations have a page about how to use the tardigrade satellites as aws replacement for the default aws s3 implementation in nextcloud over here, but it looks rather unfinished and more like a work in progress at the time of writing this post.


Setting up the storj gateway

The first step is to register at tardigrade.io, add some payment details, create a project and getting an API key. As stated, i am not going to much into detail with the satellite side of things.

Next, it’s time to install and configure the storj S3 compatible gateway. Even tough the commands listed at the tardigrade documentations are for systemwide install and will require root rights, everything will work perfectly fine if run in the home directory. Shared hosting providers won’t be a problem as long as you do have ssh access. I will show you a home-directory based installation, since i am setting up a shared webhost instance.

curl -L https://github.com/storj/storj/releases/latest/download/gateway_linux_amd64.zip -O && unzip gateway_linux_amd64.zip

Next, call the setup command and follow its instructions. Save the key and secret from its output.

./uplink_linux_amd64 setup

Last step for the gateway is starting it. You can put it in to autostart or add an @reboot cron job so your nextcloud instance will be availabe after a reboot.

./gateway_linux_amd64 run

Now that we have finished the gateway part, lets setup nextcloud. Download the latest nextcloud server and unzip it.

Setting up Nextcloud

wget https://download.nextcloud.com/server/releases/nextcloud-18.0.2.zip
unzip nextcloud-18.0.2.zip
cd nextcloud

now add a file called ‘storage.config.php’ to the config folder. Instead of nano you can use any text editor of your choice

cd config
nano storage.config.php

Add the following content

<?php
$CONFIG = [
	'objectstore_multibucket' => [
		'class' => 'OC\\Files\\ObjectStore\\S3',
		'arguments' => [
			'num_buckets' => 64,
			'bucket' => 'storj',
			'autocreate' => true,
			'key' => 'AAAAAAAAAAAAAAAAAAAAAAAA',
			'secret' => ' AAAAAAAAAAAAAAAAAAAAAAAA',
			'hostname' => '127.0.0.1',
			'port' => 7777,
			'use_ssl' => false,
			'region' => '',
			// required for some non Amazon S3 implementations
		'use_path_style'=> true,
		],
	],
];
?>

Replace key and secret with the values from the gateway setup step.

Thats it, now open your browser and surf to your nextcloud install and complete the setup as usual. You can now upload data to storj via nextcloud

Leave a Reply

Your email address will not be published. Required fields are marked *