Docker Guided Installation

 

1. Installing docker

Users will first need to install the run Docker.

Docker Download

 

2. Download 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. Or go to the download section on this site to download the zip.

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

Screenshot from 2020-12-08 18-24-00.png
 

3. Environment Variables

After unzipping the file navigate to the root of the created folder. First install the node modules using the command.

npm install

You also need to build the project so you can enter the environment details through the webUI.

npm run build

Before running myDrive users must create the environment variables files, 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

If done correctly the ouput in the terminal should say “Please navigate to http://localhost:3000 to enter setup details”.

You can also access this through the hosts IP address and port if you choose, for example “http://192.168.0.28:3000”.

If you would rather create environment variables manually please go to the environment variables section.

Now use a browser and navigate to the URL listed.

If everything works you should see a screen similar to the screenshot.

Use Docker: Select “Yes” for this option, you will then be asked if you want to include mongoDB or not. If you do not want to include mongoDB with the docker image you will be asked to enter the mongoDB URL.

Use webUI for encryption key: It is recommended that you leave this on “Yes”, this will make it so before myDrive starts it will host a server with a web page where you can enter the encryption key. If you would rather myDrive start up without the webUI first, you can select “No” you will then have to enter the encryption key directly before it.

WARNING: Either way you choose to enter the encryption key you must keep this key safe, and DO NOT lose it. This is the key that encrypts all of the files and more. If you lose this key there is no way to recover it, and all your files will be lost.

Enter client URL: This is the URL that you will type into the browser to access myDrive. For example you could choose http://localhost:3000 this option would only allow you to access myDrive on the hosted machine keep in mind. If you want to be able to access myDrive from other devices on your network you must use the host machines IP address, for example http://192.168.0.28:3000 . If you want to be able to access myDrive anywhere regardless if you are on the same network, you must look into port forwarding is you are hosting myDrive on your own machine.

Pick a database: The default option is recommended in most cases, this will store myDrive files right on your local machine in a folder that you specify right below it in the “Enter the filesystem path”. For example you could use a path that looks like this “/home/subnub/Documents/mydrive-3-data/”. This will then store the myDrive data in the folder called “mydrive-3-data”. Keep in mind if you are using windows this path will look a little different. You also have the option to store myDrive files in Amazon S3, or just inside mongoDB itself.

Enter Access Token Secret: This is the password for signing access tokens, if this key is lost users will just be required to log back into their account, so you can change it at anytime. Just make its a secure and long password.

Enter Refresh Token Secret: This is the password for signing refresh tokens, if this key is lost users will just be required to log back into their account, so you can change it at anytime. Just make its a secure and long password.

Enter Cookie Secret: This is the password for signing refresh tokens, if this key is lost users will just be required to log back into their account, so you can change it at anytime. Just make its a secure and long password.

Use Secure Cookies: This will only work if you are using a HTTPS/SSL connection. If you are select “Yes”, if not select “No”.

Use SendGrid To Send Emails: You can have email verification and password resets for user accounts if they forgot their password if you select “Yes” on this option. If you select yes you will need to create a sendgrid account and enter the API key. If you select no email verification will not be required and users will not be able to reset their passwords if they forgot it, they will still be able to change their passwords in settings if they know their old password.

Use SSL: This is if you have a SSL certificate and want HTTPS. If you are using a service like Heroku that provides its own SSL encryption you can select no here. It is highly recommended to use HTTPS/SSL when accessing the myDrive website otherwise you are vulnerable to man in the middle attacks.

setup17.png
 

4. Build docker image

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

docker-compose build

or if you’re not using the included mongoDB image

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

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

setup17.png
 

5. Start 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.

If you did not choose the webUI for encryption key myDrive will start (if you did choose use webUI go to step 6). Navigate to the URL you entered in the setup in your web browser. If everything is working correctly you will see the login screen, and you will be able to create an account.

Congratulations! You have finished setting up myDrive.

setup17.png
 

6. Enter webUI Key

Before you can use myDrive you must enter the encryption key. The terminal should tell you to navigate to localhost to enter this key.

You can access this server from http://localhost:3000 or from the hosts IP address as stated before.

I recommend using localhost since it is safer. If you're using a service like SSH or a Droplet, you can forward the localhost connection safely like so:

ssh -L localhost:3000:localhost:3000 username@ip_address

Note: You can also disable using the webUI for the encryption key by providing a key in the server environment variables (e.g. KEY=password), but this is not recommended because it greatly reduces security

After the webUI key is entered, or if you chose not to enter a webUI key the myDrive server will start up. You can now access myDrive from your browser using the IP address or URL you entered in the setup.

After you enter the encryption key, you should be able to access myDrive from the URL you provided in the setup. If all is well you will see the login page.

Congratulation! You have successfully setup myDrive. You should now to able to create an account and login.