Bokeh server on one computer, serving another computer

bokeh curdoc
run bokeh server in jupyter notebook
bokeh serve curdoc
bokeh serve dev
bokeh server set port
bokeh application
flask bokeh server
embedding bokeh server in django

Probably a simple question. I'm a newbie

I have a local computer (computer 'A') and a remote computer (computer 'B').

I want to run a bokeh server on B and have the results show up in A's browser when I browse to localhost:8000.

First I created this file on B. It just has a simple plot with a slider. You slide the slider and the plot changes. It works when I run it on A.

import sys
import numpy as np
from tornado.ioloop import IOLoop

from bokeh.application.handlers import FunctionHandler
from bokeh.application import Application
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.server.server import Server

def modify_doc(doc):

    # Initialize the data
    power = 1
    x = np.arange(10)
    y = x**power

    # Initialize the plot and slider
    p = figure()
    p_source = ColumnDataSource(data=dict(x=x, y=y))
    p.line('x', 'y', source=p_source)
    s = Slider(start=0, end=10, value=1, step=.1, title="multiplier")

    # When the slider is changed, redraw the plot
    def callback(attr, old, new):
        x =['x']
        y = x**s.value = dict(x=x, y=y)
    s.on_change('value', callback)

    doc.add_root(column([p, s]))

def main(_):
    io_loop = IOLoop.current()
    bokeh_app = Application(FunctionHandler(modify_doc))
    server_kwargs = {}
    server_kwargs['port'] = 8000
    server = Server({'/': bokeh_app}, io_loop=io_loop, **server_kwargs)


    io_loop.add_callback(, "/")

if __name__ == '__main__':

So I copy this file to B and I run it on B by ssh'ing in and typing:


Then on A I type:

ssh root@ -N -D 7000

Note I typed 7000 not 8000. I've tried both; I don't understand why some things I've read online tell me to use a different number there.

Next I open Firefox > Preferences > Network proxy > Settings > Manual proxy configuration. I set SOCKS host to 'localhost' (without quotes) and port to 7000 and choose SOCKSv5. Click OK. In Firefox's address bar, browse to http://localhost:8000. (Note I said 8000 there not 7000. Again, not sure if that is correct but I've tried various permutations.) It says "Unable to connect".

I tried inserting this in the script but it didn't seem to have any effect. Maybe I'm way off here:

from bokeh.server.util import create_hosts_whitelist
allow_websocket_origin = ['']
create_hosts_whitelist(allow_websocket_origin, port)

I know there is another way to run a bokeh server using "bokeh serve ..." command at command line, but I'm trying to create a standalone script if possible.

Gah. This should probably be simple. What am I missing?

Have you tried the following?

On B, run:

bokeh serve --address

You can then access the application from another computer with the URL http://Bs_name_or_ip_address:5006/. If there is a firewall running on the B computer, you have to allow incoming traffic on the port.

To override the default port number (5006), use the --port NNNN argument.

See also:

Can't access bokeh server from other computer, But I failed to connect to the app (called testuni) from other computer. bokeh serve myapp --allow-websocket-origin=:5006 connecting remotely directly to a Bokeh server these will often be the same (or address might be but that's � It may be convenient or necessary to run a standalone instance of the Bokeh server on a host to which direct access cannot be allowed. In such cases, SSH can be used to “tunnel” to the server. In the simplest scenario, the Bokeh server will run on one host and will be accessed from another location, e.g., a laptop, with no intermediary machines.

following command worked for bokeh 1+ versions

bokeh serve --show --allow-websocket-origin=*:5006

Running a Bokeh Server — Bokeh 2.1.1 Documentation, One way that you might want to use the Bokeh server is during exploratory the Bokeh server is to create Bokeh Applications, and serve them with the bokeh Now set up the other half of the tunnel, from the local machine to the gateway. 1 Bokeh server on one computer, serving another computer May 26 '19 1 Matplotlib/Seaborn: Boxplot collapses on x axis Jul 30 '19 1 jupyter-notebook, ImportError: cannot import name 'Type' Mar 17 '19

I know this question is really old but I run into a similar problem and managed to solve it using the suggestion posted here:!topic/bokeh/CmweAdzkWXw

Maybe this helps someone else:

On the node where Bokeh will run:

bokeh serve &
ssh -NfR 5006:localhost:5006 user@gateway

On the local machine (e.g., laptop):

ssh -NfL localhost:5006:localhost:5006 user@gateway

Now you should be able to navigate to http://localhost:5006 to access Bokeh running on a node behind the gateway.

how to launch bokeh server for others to be able to see , Hi, If i am running bokeh server on my computer thats doing live plotting, I tried using bokeh serve --port 5100 --host but I keep From another computer in the same local network, when I hit the url� bokeh.server.connection¶ Provides the ServerSession class. class ServerConnection (protocol, socket, application_context, session) [source] ¶ Wraps a websocket connection to a client. detach_session [source] ¶ Allow the session to be discarded and don’t get change notifications from it anymore. send_patch_document (event) [source] ¶

Adding to the above answers, sometimes bokeh says

Refusing websocket connection from Origin http: //< bokeh_server_ip_address>:8000; use --allow-websocket-origin=: 8000 or set BOKEH_ALLOW_WS_ORIGIN=:8000 to permit this; currently we allow origins {'localhost:8000'}

bokeh serve --show file_name --address --port=8000 --allow-websocket-origin=<bokeh_server_ip_address>:8000

bokeh_server_ip_address is the remote server ip where you want to host the bokeh application

Running a Bokeh Server, One way that you might want to use the Bokeh server is during exploratory data Another scenario is the case where a group of several creators all want publish INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port the number of users, the power of the machine used to run on, etc., this could be a� In the next post we built a bokeh app that displayed these results. This post is a little bit different. We aren’t really doing much in terms of data science and more computer science. We’re going to spin up a light server, with the configuration that we need and go on our merry way to publishing our previously built app. What is Heroku?

how to launch bokeh server for others to be able to see?, If i am running bokeh server on my computer thats doing live plotting, how would I tried using bokeh serve --port 5100 --host but I From another computer in the same local network, when I hit the url� Original title: bokeh serve: entry point with if __name__ = '__main__': I work with a standard python installation (not anaconda) on Windows 10, bokeh is installed with pip. The standard way to start the bokeh server with 'bokeh serve' is not working: The script 'serve' is not executed. The line #

serve — Bokeh 1.0.2 documentation, serve�. To run a Bokeh application on a Bokeh server from a single Python The directory should contain a (and any other helper modules that are� What I tried to do was running a jupyter server on one computer and then opening up notebook_embed.ipynb on another computer through internet. client computer

Bokeh - Server, Bokeh - Server - Bokeh architecture has a decouple design in which objects such as plots and Academic Tutorials � Big Data & Analytics � Computer Programming and in the browser in sync with one another with the help of Bokeh Server. First, we have to develop an application code to be served to client browser. The Local Bokeh Server. I developed the static map using 2018 data and Median Sales Price in Colab in order to get the majority of the code working prior to adding the interactive portions. In order to test and view the interactive components of Bokeh, we need to follow these steps. Install the Bokeh server on your computer.