Getting Started
Installation
Swing Music is available as precompiled binaries for both Windows and Linux.
Download the latest binary file from the download page and run it. That's all of it.
For Linux users, you need to make the file executable using chmod
to run it.
Something like this.
chmod +x ./swingmusic
chmod +x ./swingmusic
Docker
Pull the official Docker image from Docker Hub and run it.
docker pull geoffrey45/swingmusic
docker pull geoffrey45/swingmusic
Replace /path/to/music
with your music location and /path/to/config
with the path you want the config to be created.
docker run --name swingmusic -p 1971:1970 \
-v /path/to/music:/music -v /path/to/config:/config \
--restart unless-stopped geoffrey45/swingmusic
docker run --name swingmusic -p 1971:1970 \
-v /path/to/music:/music -v /path/to/config:/config \
--restart unless-stopped geoffrey45/swingmusic
You can use multiple music folders by mounting them to /music
.
-v /path/1:/music -v /path/2:/music
-v /path/1:/music -v /path/2:/music
You can pass Swing Music options at the end of the docker run
command.
--restart unless-stopped geoffrey45/swingmusic --help # print help text
--restart unless-stopped geoffrey45/swingmusic --help # print help text
Options
Options are flags that can be passed when starting the app in the terminal to tweak runtime settings or perform tasks.
Option | Short | Description |
---|---|---|
--help | -h | Show this help message |
--version | -v | Show the app version |
--host | Set the host | |
--port | Set the port | |
--config | Set the path to create the config folder | |
--no-periodic-scan | -nps | Disable periodic scan |
--scan-interval | -psi | Set the periodic scan interval in seconds. Default: 600 seconds (10 minutes) |
--build | Build the application (in development) |
About Periodic Scans
The app periodically checks for new tracks and any changes to your library after 10 minutes. The following activities are performed:
- Rescaning directories for new music
- Extracting missing thumbnails
- Downloading missing artist images
- Extracting colors from the downloaded images
- Downloading similar artist data for discovered artists (Note: some artists don't have similar artist data)
If your library grows rapidly over a short period, ie. by adding new tracks often, you should leave the periodic scans on. You can also modify the duration between periodic scans by using the -psi
flag like this:
swingmusic -psi 10800 # 3hrs
swingmusic -psi 10800 # 3hrs
All the activities listed above are run on boot regardless of the -psi
flag.
Watchdog
Swing Music watches for new music and file moves or deletes. The watcher does not work on mounted drives but works fine on the drive running the OS.
On Linux, you might have an inotify watch limit error:
Failed to start watchdog. [Errno 24] inotify instance limit reached
Failed to start watchdog. [Errno 24] inotify instance limit reached
You can fix it by increasing the watch limit. On Debian, Ubuntu, or similar:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
On Arch Linux:
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
You can get more info on this StackOverflow thread.
Standalone client
In v1.3.0
, PWA support was added for mobile use, though it can also be used with desktop. That means you can install the client as an app on your desktop or phone.
On mobile
The client is unusable as a mobile website due to the browser elements like the URL bar. Therefore, you need to install the client as an app.
If you don't get a prompt asking you to Add Swing Music to Home screen
, click the 3 dots at the top right corner and select Add to Home screen
.
On desktop
In Chrome or Edge browser, click the install button in the URL bar.
Firefox desktop does not support the installation of PWAs on localhost. So it's not documented here.
Remote access
To access your app from outside your local network, you need to set up a reverse proxy. Here are some tools I've tried: