A Docker container for MEGAcmd (Mega.nz) designed for ARM64 and AMD64 devices.
4.0K
Github Repo: https://github.com/zyetta/mega-container-client
A Docker container for MEGAcmd (Mega.nz) designed for ARM64 (Apple Silicon, Raspberry Pi) and AMD64 (Intel/AMD) devices.
It handles:
services:
mega:
image: zyetta/mega-sync:latest
container_name: mega-sync
restart: unless-stopped
environment:
# Pair 1
- SYNC_LOCAL_1=/data/documents
- SYNC_REMOTE_1=/CloudDrive/Documents
# Pair 2
- SYNC_LOCAL_2=/data/photos
- SYNC_REMOTE_2=/CloudDrive/Photos
# Monitoring (Optional)
- GOTIFY_URL=https://gotify.example.com
- GOTIFY_TOKEN=your_app_token
volumes:
# CONFIG: Stores your login session (CRITICAL)
- ./mega-session:/root/.megaCmd
# DATA: Your local folders to sync
- ./my-documents:/data/documents
- ./my-photos:/data/photos
Because MEGA requires 2FA, you cannot login via environment variables. You must do it interactively one time.
Start the container:
docker compose up -d
Enter the container:
docker exec -it mega-sync bash
Login manually:
mega-login [email protected] "your_password" --auth-code=123456
Wait for the login to succeed and fetch your file list.
Exit the container:
exit
Now that you are logged in, restart the container. The startup script will detect your session and automatically configure the sync folders defined in your environment variables.
docker compose restart mega-sync
You can add as many sync pairs as needed by incrementing the number (up to 10 by default).
| Variable | Description |
|---|---|
| SYNC_LOCAL_X | The path inside the container (mapped to your host) |
| SYNC_REMOTE_X | The path on your MEGA Cloud Drive |
| GOTIFY_URL | (Optional) URL of your Gotify server |
| GOTIFY_TOKEN | (Optional) Gotify Application Token |
| Volume | Description |
|---|---|
| /root/.megaCmd | Required. Stores session ID and cache. Map this to a host folder to survive restarts. |
Content type
Image
Digest
sha256:882caa862…
Size
95.1 MB
Last updated
7 months ago
docker pull zyetta/mega-sync