Provide a customizable Bokeh Server Tornado application.


Provides a Server which instantiates Application instances as clients connect

class Server(applications, **kwargs)

A Server which creates a new Session for each connection, using an Application to initialize each Session.

Parameters:(dict of str (applications) – bokeh.application.Application) or bokeh.application.Application: mapping from URL paths to Application instances, or a single Application to put at the root URL The Application is a factory for Document, with a new Document initialized for each Session. Each application should be identified by a path meant to go in a URL, like “/” or “/foo”
num_procs (str):
Number of worker processes for an app. Default to one. Using 0 will autodetect number of cores
get_session(app_path, session_id)

Gets a session by name (session must already exist)


Gets all live sessions for an application.

show(app_path, browser=None, new='tab')

Opens an app in a browser window or tab.

Useful for testing server applications on your local desktop but should not call when running bokeh-server on an actual server.
  • app_path (str) – the app path to open The part of the URL after the hostname:port, with leading slash.
  • browser (str, optional) – browser to show with (default: None) For systems that support it, the browser argument allows specifying which browser to display in, e.g. “safari”, “firefox”, “opera”, “windows-default” (see the webbrowser module documentation in the standard lib for more details).
  • new (str, optional) – window or tab (default: “tab”) If new is ‘tab’, then opens a new tab. If new is ‘window’, then opens a new window.



Start the Bokeh Server’s IO loop and background tasks.

Parameters:start_loop (boolean, optional) – whether to start the IO loop after starting background tasks (default: True).


Keyboard interrupts or sigterm will cause the server to shut down.


Stop the Bokeh Server’s IO loop.


Stop listening on ports (Server will no longer be usable after calling this)