Installing myDrive
MyDrive offers a prebuilt Docker Image, making getting started and setup with myDrive very simple. If preferred you can also manually install myDrive through its NPM commands.
🐳 Docker
Requirements
- Docker
- MongoDB (optional, comes with
docker-compose.yml
)
Docker Compose
- Make folder for docker-compose.yml and env file.
- Copy docker-compose.yml and .env.example to your directory.
- Rename
.env.example
to.env
and fill in / change the values. - Run the following command:
docker compose up -d
- Access the app at
http://localhost:3000
Docker Run
- Pull the image
docker pull kylehoell/mydrive:latest
- Run the image
Using .env
file. Copy the .env.example
file and fill in the values.
docker run -d \
-p 3000:3000 \
--env-file ./.env \
-v /path/example/mydrive/data/:/data/ \
-v /path/example/mydrive/temp/:/temp/ \
--name mydrive \
kylehoell/mydrive:latest
Or directly pass in the environment variables
docker run -d \
-p 3000:3000 \
-e MONGODB_URL=mongodb://127.0.0.1:27017/mydrive \
-e DB_TYPE=fs \
-e PASSWORD_ACCESS=secretaccesspassword \
-e PASSWORD_REFRESH=secretrefreshpassword \
-e PASSWORD_COOKIE=secretcookiepassword \
-e KEY=encryptionkey \
-e VIDEO_THUMBNAILS_ENABLED=true \
-e TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000 \
-v /path/example/mydrive/data/:/data/ \
-v /path/example/mydrive/temp/:/temp/ \
--name mydrive \
kylehoell/mydrive:latest
- Access the app at
http://localhost:3000
💻 Non - Docker
Requirements
- Node.js (20 Recommended)
- MongoDB (Unless using a service like Atlas)
- FFMPEG (Optional, used for video thumbnails)
- build-essential package (If using linux)
- Install dependencies
npm install
- Create Environment Variables
You can find enviroment variable examples under:
backend/config -> Backend Enviroment Variables
src/config -> Frontend Enviroment Variables
Simply remove the .example from the end of the filename, and fill in the values.
Note: In most cases you will only have to change FE enviroment variables for development purposes.
- Run the build command
npm run build
- Start the server
npm run start
Possible installation issues
Make issue
npm error gyp ERR! stack Error: not found: make
This is because you do not have the build essentials installed which is required for Linux. You can install them by running the following command:
sudo apt-get install build-essential
Memory issue
Aborted (core dumped)
When running the npm run build
command it may take more memory than node allows by default. You will get the above error in such a case. To fix this, you can run the following command instead when building:
NODE_OPTIONS="--max-old-space-size=4096" npm run build
You can read more about this issue here.