Your CD Collection as a Streaming Service: A Guide for Ubuntu and Nextcloud
Your own CD collection full of beloved treasures is gathering dust and taking up space. At the same time, you’d like to be less dependent on the goodwill of streaming providers, who could theoretically cut off your access to your music in the cloud at any time. If that describes your situation, then I have a guide for you that solves both problems in one go.
For this you need a PC with a CD drive running Ubuntu, the CD ripping software Asunder, the tagging program EasyTag, optionally a scanner or a phone camera to digitize the CD covers, Gimp for cropping, your own Nextcloud to store the data, and the Android app Symfonium to play the music on your phone. The software is mostly free: Asunder, EasyTag and Gimp are available through Ubuntu’s package management. For Ubuntu, a simple old Windows 7 laptop is enough, which you can find for as little as 40 euros on kleinanzeigen.de, ebay.de or willhaben.at.
The Symfonium Android app costs about 5 euros and is available on the Google Play Store as well as F-Droid. A managed Nextcloud instance is available from Hetzner for about 5 euros.
If you also have old cassettes lying around at home in addition to CDs, I have another article for you on how to digitize those as well.
But now on to the actual workflow:
Installation
Run the following commands in the Ubuntu terminal to install the software:
- Asunder:
sudo apt-get install asunder - Matching audio codecs:
sudo apt-get install lame vorbis-tools flac libopus0 wavpackSource - EasyTag:
sudo apt-get install easytagSource - Gimp:
sudo apt-get install gimpSource
Step 1: Ripping the CD
Hardware: Laptop with CD drive
Software: Asunder
Workflow:
- Open Asunder
- Insert the CD into the drive
- Asunder automatically detects the artists, titles and other metadata via CDDB. All information can be adjusted manually. For example, it’s a good idea to adjust the genre to keep things consistent. If the data isn’t recognized, it can be entered manually. A more efficient option is an AI-assisted workflow using text recognition on the CD cover, which I’ll get to later. In that case, just fill in the album artist and title as well as genre and year, and leave the tracks at their default values for now.
- Click “Rip”. The CD is now being ripped. Under “Preferences”, in the “General” tab, you can configure the destination folder, e.g.
/home/<username>/Music/ingest, for easy access via the Ubuntu file manager. It’s also a good idea to tick “Eject disc when finished”. That way you’ll notice when the ripping process is done. In the “Encode” tab you can set the desired quality. The WAV format offers lossless CD quality, but is better suited for long-term archiving than for streaming, because the files take up 10 times as much space as MP3. With a poor internet connection, smooth streaming isn’t possible. MP3 at 320 kbps is a compressed format that isn’t suitable for, say, musicians who want to sample tracks. For streaming, however, it’s very well suited.
Step 2: Automatically completing data and downloading covers
Software:
- Python script “finalize-cd-grab.py” download here
Workflow:
- Copy the script “finalize-cd-grab.py” into the folder
/home/<username>/Music - Run the script. If you selected both “mp3” and “wav” as file formats when ripping, both formats are stored mixed together in the respective album folder under “ingest”. The script separates them and moves them to “Music/mp3” and “Music/wav” respectively, keeping the album folder in each case. The script also looks up the metadata platform Discogs to see whether CD cover images are available. If so, they are downloaded into the respective album folders. For this to work, a Discogs token must be stored as an environment variable on the machine.
To create the token, go to www.discogs.com and register. Then log in with your new account and go to www.discogs.com/settings/developers. Click the “Generate new token” button. Copy the token shown next to “Current token”. Save the token as an environment variable by running the following command: echo 'export DISCOGS_TOKEN="<token>"' >> ~/.bashrc, replacing <token> with the copied token.
For the script to work, you also need to install a few Python libraries:
sudo apt install python3-requests python3-mutagen
Besides moving the data and adding the cover, the script also takes care of setting the album artist in the MP3 tag. If all tracks on the album have the same artist, that artist is set as the album artist. Otherwise, “Various Artists” is set as the album artist. This is important so that the albums are displayed correctly in Symfonium later. Without “Various Artists” as the album artist, all tracks by different artists would later show up as separate albums.
Step 3: Manual check
Software:
- File manager
- EasyTag
- Bash script “match-filenames.sh” download here
- Gimp
Workflow:
- Manually browse the mp3 folder in the file manager to check whether covers were downloaded. If so, delete all other files except the front cover, otherwise Symfonium can get confused. If not, search for covers online using Google image search and download them into the album folder. If that doesn’t work either, photograph or scan the cover and copy it into the album folder. Photographed covers can be cropped with Gimp’s “Rectangle Select” tool. If the alignment is off, it can be corrected with Gimp’s “Rotate” tool. Just adjust the angle until the cover lines up with the top edge of the screen. Then save the file with “Export As” as a JPG at the highest quality.
- Go through the mp3 folder with EasyTag to check whether all MP3 tags were written correctly, and adjust them if necessary
- If your adjustments result in changes to the file names of the MP3 files, run match-filenames.sh to apply these changes to the WAV files as well.
Step 4: Post-processing CDs without a CDDB entry
Software:
Workflow:
- Take a photo of the CD tracklist
- Open an LLM in the browser, e.g. chatgpt.com or claude.ai. I’ve had the best experience with the latter
- Upload the image of the tracklist.
- Run the following prompt: “Please transcribe the text in the attached image to create a tracklist”. The tracklist is generated.
- Check the tracklist and prompt for changes if necessary
- Copy the individual titles into EasyTag, then use the “Scanner > Rename File” function to generate file names from the tags.
- The Windows software “Mp3tag” can import text files with meta information, which simplifies the process further. Since this guide is about Ubuntu, I’ll skip that here.
Step 5: Nextcloud upload
Software: Nextcloud, file manager
Workflow:
- Open your personal Nextcloud in the browser
- Upload the files from the “mp3” folder, e.g. to “Symfonium/CDs-mp3”
- Upload the files from the “wav” folder, e.g. to “Music/CDs-wavs”. Careful: don’t upload them to the Symfonium folder, otherwise the albums will show up twice in the app
Step 6: Subsonic setup
Software: Nextcloud, Symfonium
Workflow:
- Log in to Nextcloud as admin and navigate to “Apps” in the user menu
- Open the search with the search icon and search for “Music”
- Install the app if you haven’t already
- Open the app by clicking the music note icon in the toolbar
- Click “Settings” at the bottom left
- Scroll down to the “Ampache and Subsonic” section. There you’ll find the Subsonic URL, which you’ll need for the next step
Step 7: Symfonium setup
Software: Symfonium
Workflow:
- Install the Symfonium app from the Google Play Store or F-Droid
- Open the app. Go to Manage settings > Media sources and select “Add media source”.
- Select Subsonic and enter the URL from step 6
- Log in if necessary
- Symfonium is now set up for playback, and your phone should automatically sync the metadata from Nextcloud. During playback, the data is streamed from Nextcloud, so no storage space is needed on your phone for the entire MP3 library.
Happy streaming!