Skip to content

Guided Installation Setup (Docker)

subnub edited this page Jun 12, 2020 · 12 revisions

Guided Installation

This page will help beginners to install and run myDrive, this guide will run myDrive using Docker, view the other guides to get myDrive running on a local machine or a Droplet.

  1. Installing Docker
  2. Downloading myDrive
  3. Setup myDrive
  4. Environment Variables
  5. Building myDrive
  6. Running myDrive

1. Installing Docker

Users will first need to install the run Docker.

Docker Download

2. Downloading myDrive

Next, Download myDrive from the main Github page, the easiest way to do this is to select 'Download Zip' from the 'Clone and Download' section. But you can also clone myDrive with the following command.

git clone https://github.com/subnub/myDrive.git

3. Setup myDrive

Next unzip the file, you should now have the following files, after this open up a terminal in the myDrive directory.

4. Environment Variables

Before running myDrive users must create the environment variables file, myDrive comes with a built-in tool to make this much easier, run the following command to start creating the environment variables.

npm run setup

The first prompt will ask if you would like to use Docker or not, since this is the guide to run myDrive on Docker you should select 'yes'.

Next myDrive will ask if you'd like to include mongoDB with the myDrive image, if you're using a service such as Atlas select 'no', otherwise select 'yes, in this guide we will be selecting 'yes'.

Next myDrive will ask if you'd like to use the WebUI to enter the encryption key, the encryption key is used to encrypt all the myDrive data, using the WebUI is recommended since its the most secure, but you can also select no and enter the encryption key now if you'd like.

Next myDrive will ask for the clients URL/IP address, this is the IP address of the local machine and the port number, or just the URL if you purchased a domain name. This MUST be a valid URL even if it's just an IP address, and if you're using an IP address you must specify the port number which is 3000 by default, for example if the IP address is '192.168.0.63', you'd use the following format.

http://192.168.0.63:3000

Next myDrive will ask what backend you would like to use to store the file chunks, there are 3 options to choose from, Amazon's S3, the Filesystem, and then just MongoDB. We will use the Filesystem in this example, but if you'd like to use Amazon S3 or just MongoDB myDrive will guide you through each step.

Now enter a file path to store the myDrive chunk data in.

Next enter a JWT secret, this is a password used to sign the JWT tokens when logging into accounts, this is different from the encryption token, and this JWT secret can be changed at any time (it was just cause all users to be signed out).

Next myDrive will ask if you have the SSL certificate, this allows data to be encrypted when it's sent over the internet, this is highly recommended if you plan to store sensitive data inside of myDrive, but in this guide we will select 'no' to make things simple. But if you do have the SSL certificate, use the following naming format on the root or the project.

certificate.crt, certificate.ca-bundle, And certificate.key

You should get the following message if all the environment variables were created successfully.

5. Building myDrive

Users must first build the Docker image, to do this run the following command.

docker-compose build

or

docker-compose -f docker-compose-no-mongo.yml build

Use the first build command if you're using the Docker image that includes mongoDB, use the second command if you're not using the Docker image that includes mongoDB.

If the build finishes successfully, you will get the following output.

6. Running myDrive

To start myDrive use the following command.

docker-compose up

or

docker-compose up -d

The '-d' will run myDrive in detached mode, if you wish to keep myDrive running in the current terminal, use the first command instead.

Before myDrive starts up the myDrive server, it will first create a webUI to navigate to in order to enter the encryption key (unless you selected otherwise in the previous steps), use any web browser on the local machine, and navigate to.

http://localhost:3000

This is the WebUI, enter the encryption key here, DO NOT lose this encryption key, there is no way to recover a lost encryption key, and all of your data will be lost.

When the encryption key is entered, myDrive will start the main server, and you should have the following output.

MyDrive is now running! Now just navigate to the client URL you entered earlier (Your local machine's IP address, or the domain name), and create a new account!

Clone this wiki locally