Skip to content

Guided Installation Setup

subnub edited this page Jun 7, 2020 · 17 revisions

Guided Installation

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

1. Installing Node.js

Users will first need to install Node.js, this is used to run myDrive, as well as install all of its dependencies. MyDrive works best with Node.js 13+, so I recommend using the latest version instead of the LTS.

Node.js Download

2. Installing MongoDB

Users will also need to install MongoDB unless you're using some type of service like Atlas or DocumentDB, MongoDB is used to store all the user, and file metadata information.

MongoDB Download

MongoDB Installation/Setup Guide

3. 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

4. Setup myDrive

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

Now run the following command in order to install all the myDrive dependencies.

npm install

If everything is installed correctly, you should get an output similar to this screenshot.

5. 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 a local machine you should select 'no' for this prompt.

Next myDrive will ask you for the mongoDB url, if you are running mongoDB on the same local machine use the following url.

mongodb://127.0.0.1:27017/personal-drive

Otherwise enter the MongoDB/Atlas URL.

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.

6. Building myDrive

Users must first build myDrive, this is only needed to be done once (or every time you update to a new version of myDrive). Run the following command to build myDrive.

npm run build

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

Recommended: Create the Database indexes, this will improve the mongoDB performance when searching for files, mongoDB must be running for this command to work, use the following command.

npm run create-indexes-database

7. Running myDrive

To start myDrive use the following command.

npm run start

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