Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Funkwhale
  3. How to get music in?
Everything related to the PHP CVE and eMudhra Cert Please read our Security issue thread - PHP and eMudhra cert compromise.

How to get music in?

Scheduled Pinned Locked Moved Funkwhale
12 Posts 4 Posters 2.1k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jdaviescoatesJ jdaviescoates

    I already have a Volume called Music at /media/Music so I mounted that in the Storage settings of the app and then as per the docs here https://docs.funkwhale.audio/administrator/configuration/env-file.html I created the following within env.sh using the File Manager

    MEDIA_ROOT="/media/Music"

    also tried:

    MEDIA_ROOT=/media/Music

    Neither resulted in anything being displayed in Funkwhale.

    Has anyone got this working yet?

    Thanks!

    PS I thought we normally had env instead of env.sh in Cloudron apps these days? 🤔

    J
    J
    joseph
    Staff
    wrote on last edited by joseph
    #3

    @jdaviescoates said:

    PS I thought we normally had env instead of env.sh in Cloudron apps these days? 🤔

    env.sh -> export required
    env -> no export required

    1 Reply Last reply
    2
    • jamesJ james

      Hello @jdaviescoates

      Please try to use:

      export MEDIA_ROOT="/media/Music"
      

      in the /app/data/env.sh file.

      jdaviescoatesJ
      jdaviescoatesJ
      jdaviescoates
      Super Fan
      wrote on last edited by
      #4

      @james said:

      Hello @jdaviescoates

      Please try to use:

      export MEDIA_ROOT="/media/Music"
      

      in the /app/data/env.sh file.

      That didn't seem to make any difference. Any my server is running out of space so for now I've just deleted the app to free app a little.

      I use Cloudron with Gandi & Hetzner

      1 Reply Last reply
      0
      • jdaviescoatesJ jdaviescoates

        I already have a Volume called Music at /media/Music so I mounted that in the Storage settings of the app and then as per the docs here https://docs.funkwhale.audio/administrator/configuration/env-file.html I created the following within env.sh using the File Manager

        MEDIA_ROOT="/media/Music"

        also tried:

        MEDIA_ROOT=/media/Music

        Neither resulted in anything being displayed in Funkwhale.

        Has anyone got this working yet?

        Thanks!

        PS I thought we normally had env instead of env.sh in Cloudron apps these days? 🤔

        rmdesR
        rmdesR
        rmdes
        wrote on last edited by rmdes
        #5

        @jdaviescoates you should mount the volume at /app/data/music in Cloudron's Storage settings instead of /media/Music.

        The package already expects music files at /app/data/music/, nginx already serves from there, and the env vars already point there. No env.sh changes needed, just change the mount point in Cloudron's UI.

        I have not tested with a volume mount (I'm still loading all my collection within /app/data/music natively in the container, but I will transition to volume mount soon

        1 Reply Last reply
        0
        • rmdesR
          rmdesR
          rmdes
          wrote on last edited by rmdes
          #6

          Another way to import music fast :

          In-place import means Funkwhale indexes your music files without copying them — it reads the metadata (tags) and creates database entries, then streams directly from the original location.

          In the Cloudron context, it would work like this:

          1. Mount the volume at /app/data/music in Cloudron's Storage settings
          2. Files are immediately visible to Funkwhale - MUSIC_DIRECTORY_PATH already points there
          3. Import via CLI from the web terminal:
          /app/code/manage.sh import_files <library_id> "/app/data/music/" --in-place --recursive
          
          1. (Get your library ID from the Funkwhale web UI, create a library first if you haven't)
          2. Streaming works because nginx already serves /_protected/music/ from /app/data/music/ via X-Accel-Redirect, the files are served directly, no duplication

          The package even has scheduler tasks for maintaining in-place imports:

          • check_inplace_files_check - dry-run to see if any referenced files are missing
          • check_inplace_files_apply - actually update the database for missing files

          So the key point for the user: mount at /app/data/music, then in-place import just works out of the box. Their files stay on the mounted volume, Funkwhale only stores metadata in PostgreSQL, and nginx serves the audio directly from disk.

          jdaviescoatesJ 1 Reply Last reply
          1
          • rmdesR rmdes

            Another way to import music fast :

            In-place import means Funkwhale indexes your music files without copying them — it reads the metadata (tags) and creates database entries, then streams directly from the original location.

            In the Cloudron context, it would work like this:

            1. Mount the volume at /app/data/music in Cloudron's Storage settings
            2. Files are immediately visible to Funkwhale - MUSIC_DIRECTORY_PATH already points there
            3. Import via CLI from the web terminal:
            /app/code/manage.sh import_files <library_id> "/app/data/music/" --in-place --recursive
            
            1. (Get your library ID from the Funkwhale web UI, create a library first if you haven't)
            2. Streaming works because nginx already serves /_protected/music/ from /app/data/music/ via X-Accel-Redirect, the files are served directly, no duplication

            The package even has scheduler tasks for maintaining in-place imports:

            • check_inplace_files_check - dry-run to see if any referenced files are missing
            • check_inplace_files_apply - actually update the database for missing files

            So the key point for the user: mount at /app/data/music, then in-place import just works out of the box. Their files stay on the mounted volume, Funkwhale only stores metadata in PostgreSQL, and nginx serves the audio directly from disk.

            jdaviescoatesJ
            jdaviescoatesJ
            jdaviescoates
            Super Fan
            wrote on last edited by jdaviescoates
            #7

            @rmdes said:

            So the key point for the user: mount at /app/data/music

            But unless I've misunderstood Cloudron Volumes cannot be mounted there, they are always at /media/volume-name , no?

            Perhaps it's possible to symlink or something?

            But, I think if I set MUSIC_DIRECTORY_PATH to (in my case) /media/Music I'd guess it would've worked... will have another play...

            I use Cloudron with Gandi & Hetzner

            1 Reply Last reply
            0
            • J
              J
              joseph
              Staff
              wrote on last edited by
              #8

              Looking at the repo, there are three paths:

              export MEDIA_ROOT="/app/data/media"
              export MUSIC_DIRECTORY_PATH="/app/data/music"
              export MUSIC_DIRECTORY_SERVE_PATH="/app/data/music"
              

              What's the difference between music and media 🤔 cc @james

              1 Reply Last reply
              1
              • jamesJ
                jamesJ
                james
                Staff
                wrote on last edited by
                #9

                According to the documentation of Funkwhale:

                MEDIA_ROOT

                The path where you store media files (such as album covers or audio tracks) on your system. Make sure this directory actually exists.

                MUSIC_DIRECTORY_PATH

                The path on your server where Funkwhale places files from in-place imports. This path needs to be readable by the webserver and api and worker processes.

                MUSIC_DIRECTORY_SERVE_PATH

                On Docker setups the value of MUSIC_DIRECTORY_PATH may be different from the actual path on your server. You can specify this path in your docker-compose.yml file

                When setting this in the /app/data/env.sh and creating the folders and setting the correct permissions manually.
                A media file was uploaded to the volume.

                export MEDIA_ROOT="/media/External SSD/funkwhale/media"
                export STATIC_ROOT="/media/External SSD/funkwhale/static"
                export MUSIC_DIRECTORY_PATH="/media/External SSD/funkwhale/music"
                export MUSIC_DIRECTORY_SERVE_PATH="/media/External SSD/funkwhale/music"
                
                1 Reply Last reply
                1
                • J
                  J
                  joseph
                  Staff
                  wrote on last edited by
                  #10

                  thanks @james. ok, so MEDIA_ROOT is like metadata and MUSIC_DIRECTORY_PATH is the real music. .

                  jamesJ 1 Reply Last reply
                  0
                  • J joseph

                    thanks @james. ok, so MEDIA_ROOT is like metadata and MUSIC_DIRECTORY_PATH is the real music. .

                    jamesJ
                    jamesJ
                    james
                    Staff
                    wrote on last edited by
                    #11

                    @joseph
                    As I understood it, not even that.
                    MEDIA_ROOT is where all media uploaded gets stored.
                    MUSIC_DIRECTORY_PATH is like an import folder where you can manually upload files that then get imported.
                    But I am not 100 % certain, it is still confusing for me.

                    1 Reply Last reply
                    1
                    • jdaviescoatesJ
                      jdaviescoatesJ
                      jdaviescoates
                      Super Fan
                      wrote last edited by
                      #12

                      I finally got this working with Claude's help, so I asked it to write this quick guide for anyone else wanting to use music from a Cloudron Volume with Funkwhale (2.x) via in-place import (no copying).

                      1. Mount the volume
                      In the app's Storage settings, add the volume as a mount (read-only is fine). It appears at /media/<VolumeName>.

                      2. Don't change the env vars
                      Leave MUSIC_DIRECTORY_PATH and MEDIA_ROOT unset in /app/data/env.sh. The package's nginx config (/run/nginx.conf) serves in-place files from /app/data/music/ regardless, so pointing MUSIC_DIRECTORY_PATH at /media/... lets the import run but breaks playback. Remove any lines you've added and restart the app.

                      3. Symlink the volume into /app/data/music
                      In the Web Terminal, replacing <VolumeName> with your volume's name:

                      ln -s /media/<VolumeName> /app/data/music/<VolumeName>
                      chown -h cloudron:cloudron /app/data/music/<VolumeName>
                      

                      If your music sits in a subfolder of the volume, link that subfolder instead. nginx follows the symlink fine.

                      4. Get a library ID
                      Funkwhale 2.x creates built-in libraries per user (me / followers / instance / everyone) and the old /content/libraries/ page has gone, so list them from the terminal:

                      source /run/funkwhale/env.sh
                      source /app/code/venv/bin/activate
                      gosu cloudron:cloudron funkwhale-manage shell -c "from funkwhale_api.music.models import Library; [print(l.uuid, l.name, l.privacy_level, l.actor) for l in Library.objects.all()]"
                      

                      5. Import in place
                      Test with one folder first:

                      gosu cloudron:cloudron funkwhale-manage import_files <library-uuid> "/app/data/music/<VolumeName>/<Some Artist>/" --recursive --noinput --in-place
                      

                      Then for the full library, run it detached so closing the terminal doesn't kill it (queuing ~100k files over an SSHFS mount took me a few hours):

                      setsid nohup gosu cloudron:cloudron funkwhale-manage import_files <library-uuid> "/app/data/music/<VolumeName>/" --recursive --noinput --in-place --async > /tmp/fw-import.log 2>&1 &
                      

                      Check progress with tail /tmp/fw-import.log.

                      Keeping it in sync
                      I sync new music onto the volume with the Syncthing app on the same server, so next I'm going to try import_files ... --watch --prune as an @service line in the app's Cron section. Will report back on whether that works over an SSHFS-mounted Storage Box.

                      I use Cloudron with Gandi & Hetzner

                      1 Reply Last reply
                      2

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search