Replies: 1 comment 7 replies
-
Very nice. I have considered implementing ABS as a service, but in the end I decided to make it as simple as possible for the sake of not complicating things for novice users. If there's a lot of interest in making this (installing as a service) a feature of audiobokshelf-windows, I'm willing to consider it. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For anyone interested, I have been successfully running Audiobookshelf as a Windows service for several months and it has proven to be very stable in this configuration. Since the primary means of interacting with the application is through the Web UI, there is no sacrifice in functionality. The only change in behavior is, when installing an update, you must manually stop the service, run the installer, and then restart the service when completed. I've documented the procedure below in case anyone is interested.
Please note: Though fully functional, this is not the way the author intended the application to be run. By running as a service, you are taking responsibility and should not expect the author (mikiher) to support this configuration.
What is a Windows Service and Why run Audio Bookshelf as a Windows service?
In a nutshell, a windows service is a program that runs automatically when Windows starts. This differs from putting a program in the Startup folder in that services do not require a user to log-in in order to start and do not require a user to stay logged-in to continue running. Even if the computer is rebooted, the service will start up as soon as the machine comes back up. This is very handy when running on a home server that you want to be constantly available. In my case, I consider Audiobookshelf a critical media service that I want running 24x7 so there is always access to my audiobooks.
What you'll need:
The current Audiobookshelf-Windows installer
A program like NSSM (The Non-Sucking Service Manager) or similar (free download)
A computer on which to install Audiobookshelf.
Optional: A second computer on which your audiobooks are stored
Instructions:
Download and install the latest Audiobookshelf-Windows version, making note of where the executable files are saved. This is the same procedure you would use whether installing as a service or not. This would also be the time to set the ABS port as needed, and you can even configure the program. The important part is that it's installed and functional.
When you're ready to transition to a Windows Service, exit the program.
Install and launch NSSM. (The Windows SC command can also be used, as well as other 3rd party tools). In the case of NSSM, open a command prompt (not powershell) as Administrator and type "nssm install". This will bring up the following dialogue.
On the Application tab, under Path, browse to the location of your audiobookshelf.exe file. The Startup Directory should auto-populate with this same location. Be sure to specify the Service Name at the bottom. This is how the service will appear in the Services MMC.
[Optional] In the event that your audiobook files are located on a different computer, you will need to ensure that the serive is running with an account that has access to the files on that server. Switch to the "Log on" tab of the NSSM installer and specify a different account that has access. If you are in a Windows Workgroup, I suggest creating an identical account on both computers with the same name and password, then use that for access. If you are running in an Active Directory domain environment, you can just use the domain account and password.
Click on Install Service. The service should be created. Keep in mind that it won't be running until you start it.
Open Services. The easiest way is to click Start and type "Services", or you can type "servcies.msc". Once Services comes up, verify that you see the Audiobookshelf service and that its Starup Type is set to Automatic. Also verify the "Log On As" is set to your account if you changed it in Step 5.
Start the service. Just right-click on the service and select Start. You should see the Status switch ro "Running". At this point Audiobookshelf will be running as a service.
Open a web browser and verify that you can connect to Audiobookshelf like you normally would. The program will function as it always has, with configurations saved to the same location. Nothing should be different.
**** Important Note** when Updating Audiobookshelf. Before running the installer for a new version of AudioBookshelf, you must manually stop the service before installing, and then restart the service after a successful installation. Do not have the installer run the program after installation, as it will run in the foreground, not as a service. If you start the service in this state, you will have two instances running and there will likely be conflicts if they run at all.
I hope this has been helpful.
Beta Was this translation helpful? Give feedback.
All reactions