-
-
Notifications
You must be signed in to change notification settings - Fork 408
Guided Installation Setup
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.
- Installing Node.js
- Installing MongoDB
- Downloading myDrive
- Setup myDrive
- Environment Variables
- Building myDrive
- Running myDrive
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 15, if you are having issues with uploading large files use Node.js 12 instead.
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 Installation/Setup Guide
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
Next unzip the folder, you should see a myDrives source files and folders.
Now run the following command in order to install all the myDrive dependencies.
npm install
Next build the project with the following command.
npm run build
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
You will be asked to navigate to localhost in order to complete setup, but you can also use your servers IP address or URL if you wish. Navigate to this URL in a web browser.
Use Docker: If you are planning on using docker go to the docker section instead.
MongoDB URL: Enter the mongoDB URL, if you are hosting mongoDB on your local machine select the 'Use Local URL' button.
WebUI for encryption key: Select this is you would like myDrive to first open up a web server to enter the encryption key before starting myDrive. This option is recommended to you do not need to store the encryption key in an environment variable which is less safe. This is the key/password used to encrypt all of the files and user information. Do not lose this key there is no way to recover a lost key and all data will be lost.
Default ports: If you want to change the default ports for whatever reason you can do so here.
Client URL: This is the URL/IP address you are using to access myDrive. For example if you access myDrive through myDrive.com you would enter 'http://myDrive.com".
Pick a database: Choose the database you would like to store file chunks in. You have three options here and some of them will reveal more information you need to add.
Access secret: The key/password used to sign access tokens, this can be changed at any time and will just cause users to be logged out if they do not have a valid refresh token.
Refresh secret: The key/password used to sign refresh tokens, this can be changed at any time and will just cause users to be logged out.
Cookie secret: The key/password used to sign cookies, this can be changed at any time and will just cause users to be logged out.
Secure cookies: This will make cookies transfer only if they are on a HTTPS connection, you can only use this if you site uses an HTTPS connection. This is recommended if you can use it.
Sendgrid for emails: Add email verification and password resets through email with sendgrid. You will be required to create a sendgrid account.
Use SSL: Starts myDrive also on an https server, this requires certificates to be stored at the root of the project. If you are hosting on a site that provides SSL/HTTPS select no for this.
After entering all information select save.
Exit out of the correct process by pressing 'ctrl+c'.
Rebuild myDrive using the rebuild command again, this is so myDrive will use the new environment variables.
npm run build
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
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.
You can also access this from your machines URL but this is not recommended since it is not over HTTPS.
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.
Once you enter the key myDrive will start up its normal server.
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!