Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[GUIDE] Set up the OneDrive Client for Linux (abraunegg) as Docker container

Featured Replies

I'm currently playing around with a trial unraid licence to see what works and what doesn't; I got this running without issue, but I'd like to know if it's possible to choose which folders to sync?

 

Looking at the guide 

sync_dir

 

would allow me to specify a directory to sync, can this be done for multiple folders?

  • 8 months later...
On 12/17/2022 at 2:13 PM, BVersluis said:

I am a new user of Unraid and Docker and was looking for an alternative to Synology Cloud Sync, which I used to keep all my family's Onedrive files as harcopy on my previous NAS (multiple accounts). I was therefor not looking for an app like Duplicati/Duplicay to spread my files even further over the cloud, but to get my files back from the cloud and keep them synchronized. For this purpose I decided to run the Onedrive Client for Linux in a separate docker container for different Onedrive accounts on my Unraid install, which seems to work quite well. Below my beginners guide for how to set this up with docker compose following this guide

Requirements:

  • Docker compose installed
  • Dynamix File Manager installed (helpful)


Step 1:
In the Unraid WebUI open the terminal and type ‘id username’ for every user with onedrive account you want to install a Onedrive container for and write down the UID and GID for these users.

 

Step 2:
Add a share called ‘onedrive’ (or choose your own name). Optionally enable cache, select preferred disk(s) and decide if you want to export the share.

 

Step 3:
If you are planning to use multiple containers/accounts, create subfolders for every user as well in the just created onedrive folder (/onedrive/userA, /onedrive/userB, etc.). Do this before running the container later on.

 

Step 4:
Create a ‘onedrive’ folder under /mnt/user/appdata/ and again create subfolders (userA, userB etc.) for different users

 

Step 5:
Go to the Docker tab, scroll down to Compose and press ‘Add new stack’

Step 6:
Type a project name (for example Onedrive-userA) and press ‘OK’ and again ‘OK’ after success

Step 7:
Click on the cog-wheel of the new created stack and press ‘Edit stack’ followed by ‘Compose file’

 

Step 8:
Past in the composer file below:

version: "3.7"
services:
    onedrive:
        image: driveone/onedrive:latest
        container_name: Onedrive-userA
        stdin_open: true # docker run -i
        tty: true        # docker run -t
        restart: unless-stopped
        environment:
            - ONEDRIVE_UID=1001
            - ONEDRIVE_GID=100
        volumes: 
            - /mnt/user/appdata/onedrive/userA:/onedrive/conf/
            - /mnt/user/onedrive/userA:/onedrive/data

 

Step 9:
Before saving, make the following changes to the composer file:

·       Change the container name in a name of your liking, for example Onedrive_UserA, Onedrive_UserB.

·       Change the UID and GID to the correct values for the user, as found in step 1

·       Under volumes change the path left from the colon to the correct config and data folder (so ‘/mnt/user/appdata/onedrive/userA’ and ‘/mnt/user/onedrive/userA’ if the example above has been followed. Don't touch the values right from the colon.

·       Optionally, if you created your custom network for docker containers, you can add the network settings below and change 'nameofyournetwork' to the name of your network. Otherwise a new network (container_name_default) is created. Example:

version: "3.7"
services:
    onedrive:
        image: driveone/onedrive:latest
        container_name: Onedrive-userA
        stdin_open: true # docker run -i
        tty: true        # docker run -t
        restart: unless-stopped
        environment:
            - ONEDRIVE_UID=1001
            - ONEDRIVE_GID=100
        volumes: 
            - /mnt/user/appdata/onedrive/userA:/onedrive/conf/
            - /mnt/user/onedrive/userA:/onedrive/data
        networks:
            - proxy
networks:
  proxy:
    external: true
    name: nameofyournetwork   

 

Step 10:
Press ‘save changes’

 

Step 11 (optional):
If you want to add an icon to your docker container (otherwise you’ll see a questionmark), press the cog-wheel again, select ‘edit stack’ and select UI labels. On the internet find a link to the icon of your choosing (for example from Onedrive’s wiki) and past the link in this field. This can be done later on as well (by updating the stack). Press ‘OK’ when done.

 

Step 12:
Press ‘Compose up’ and press ‘Done’ when it is done.

 

A new container is now created and running, but the Onedrive Client still needs to be connected to your Microsoft account with the following steps:

Step 13:
Stop the new container

 

Step 14:

In the right upper corner of the docker page, switch over from ‘Basic view’ to ‘Advanced view’. Now you can see the Container ID for your newly made container (for example 72409c107bd0). Copy this number.

 

Step 15:
Open the Unraid terminal and enter:

docker start your_container_id --interactive

Use right mouse and paste to paste your container ID in the terminal.


Step 16:
After entering the command and pressing enter, the container starts in an interactive mode and a link to Microsoft is shown in the terminal. You open this link by clicking on it and log in with the Microsoft credentials of the onedrive account you want to add. If successful, a blank page is shown. Copy the full address of this page and past it (right mouse and paste) in the terminal as the response URL and press enter. If the link is accepted, the client immediately starts downloading your files.

 

Step 17:
You can close the terminal, restart the container and everything should be working from now on.

 

Step 18:

Repeat step 5-17 for every account you want to add. For some reason you need to select a different Icon URL for every new container you want to add.

 

 

In case you encounter permission errors when trying to access your downloaded files when using onedrive multiple accounts, check the solution below by Cholzer:

 

Does not automatically sync after the first time here

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.