A Howto: Running Calibre Content server on Windows Startup
#1  sherman 02-22-2010, 05:11 AM
December 2017 Update
Since this thread has seen some interest lately, I though I should probably add an update.

I consider the contents of this thread obsolete for at least two reasons:
  1. Calibre 3 no longer supports running the content server and GUI simultaneously.
  2. If using Calibre < 3, there are better ways to do this such as using a service manager like NSSM, instead of a scheduled task.

I've kept the old guide if people still wish to follow it for some reason.


Original Post

Hi folks, I thought I'd share with you my method of running the standalone calibre content server at windows startup.

This particular method works for Windows Vista/7, and probably XP as well. It may not be the only way to accomplish this task either.

The Steps

Open the Task Scheduler (Start orb > type "task" in the search > select "Task Scheduler" from list)

Choose "Create Task" from the menu at right.

Give the task a meaningful name and description.

Select the "Run whether user is logged in or not" radio button.

On the "Triggers" tab, create a new trigger. From the dropdown list at the top select "Startup", and click "Ok".

On the "Actions" tab, create a new Action. You want to "Start a program". In the "Program/Script" box, insert the location of the calibre-server program. This can usually be found in the following places:
32-bit Windows: C:\Program Files\Calibre2\calibre-server.exe
64-bit Windows: C:\Program Files (x86)\Calibre2\calibre-server.exe
If you want to pass additional options to calibre-server (eg: username/password), put these in the "Add arguments (optional)" box. Refer to the calibre-server help for information on these options. Click "Ok"

If your PC is going to be on for several days at a time, select the "Settings" tab. Uncheck the checkbox that says "Stop the task if it runs longer than:".

Click "Ok" to create the new task. You will be asked for your Windows User password - put this in to complete creating the task.

Now, either right-click the task and choose "Run" or reboot the PC to run the task.

Finally, to ensure the content server can be accessed over the network, we need to add calibre-server to the list of exceptions in the Windows Firewall. Somewhere within the Vista/7 control panel or security center there is an option to "Allow a program through Windows Firewall". Click the "Add another program", browse to the location of calibre-server.exe and add it.

So why would I want to do this?

Running the Standalone content server is useful if you don't want to have the main calibre program running constantly. Running calibre-server by double clicking it however means that you have a constand command window taking up space. You also have to remember to run it whenever you log in.
Calling it from a batch file placed in the startup folder also works, but again, you still have a command window floating around. Also both methods require you to login to your system.
Using the task scheduler method brings the content server up at Windows startup, without requireing the user to be logged in, and doesn't display a command window.

Of course, if Kovid were to implement running the content server as a windows service....

#2  Manichean 02-22-2010, 05:44 AM
What happens if I were to start Calibre while the content server already runs?

#3  sherman 02-22-2010, 06:34 AM
Quote Manichean
What happens if I were to start Calibre while the content server already runs?
So long as you don't have the "Run server automatically on startup" checkbox checked in the main calibre preferences, or start the server from the same preferences screen, there shouldn't be any problems.

What happens if somehow both are active at once? I haven't a clue. Maybe Kovid can answer that one.

#4  kovidgoyal 02-22-2010, 12:42 PM
You can't run two content servers at the same time, on the same port.

#5  sherman 02-22-2010, 12:43 PM
Quote kovidgoyal
You can't run two content servers at the same time, on the same port.
I thought that would be the case, which is why I I'm careful to run only one only one or the other at a time.

#6  kovidgoyal 02-22-2010, 12:44 PM
Basically whichever instance is run second will error out

#7  Dopedangel 11-12-2010, 03:29 PM
I use dropbox to keep my calibre library synced on multiple computers.
So I was wondering is it possible to run just calibre server using this method on one computer and manage the library from another computer or does the server also lock the metadata file.

#8  kovidgoyal 11-12-2010, 03:33 PM
the server will also lock the file.

#9  Dopedangel 11-12-2010, 04:07 PM
So can the server be run with metadata.db named to something like server.db
I am not a programmer so am not sure if its even possible but maybe someone can run with it
What I am thinking is server uses that file and updates it after a specific time lets say every half hour. We wont get real time additions and changes but that it would allow to run the server on one computer and manage the library from another it would even work with shared network drives not just dropbox and other sync software

#10  kovidgoyal 11-12-2010, 04:08 PM
You can use an environment variable to control exactly what file calibre uses to load the db from, see the customizing calibre section of the user manual.

  Next »  Last »  (1/3)
Today's Posts | Search this Thread | Login | Register