Adapted from Bokeh Examples: https://github.com/bokeh/bokeh/tree/master/examples/app/export_csv
Developed on a new Ubuntu 16.04 on digital ocean.
The following process should get you up and running from a fresh new server instance.
$ sudo apt-get install nginx git
$ wget https://repo.continuum.io/archive/Anaconda3-4.3.1-Linux-x86_64.sh
$ bash Anaconda3-4.3.1-Linux-x86_64.sh
$ # add anaconda to your PATH (.bashrc/.bash_profile) so that you can use pip/conda from anaconda
- make sure anaconda is your default systems python
$ sudo rm /usr/bin/python # remove old python symlink
$ sudo ln -s /home/ubuntu/anaconda3/bin/python /usr/bin/python # link anaconda python as system default
- Log out, then log back in
- Make sure you are using anaconda by typing
$ python
and making sure it lists your version of anaconda
$ git clone https://github.com/mlshapiro/bokeh-server-table.git
$ cd bokeh-server-table
$ sudo rm /etc/nginx/sites-available/default # remove the default site
$ ln -s /root/bokeh-server-table/conf/nginx.conf /etc/nginx/sites-available/default # make the bokeh nginx conf the default
$ sudo systemctl start nginx # start the nginx service
$ sudo systemctl status nginx # check the nginx status
- This will run server in the background on start up
$ sudo systemctl enable /home/ubuntu/bokeh-server-table/conf/bokeh.service # this creates a symlink in /etc/systemd/system/
$ sudo systemctl daemon-reload # reload conf files
$ sudo systemctl start bokeh.service # start the service
$ sudo systemctl status bokeh.service # check the status
You should be able to visit the ip address of your server and see your bokeh app running.
To set up up ufw
(NOTE: THis will remove your ssh access if done wrong):
$ sudo ufw allow 'Nginx HTTP'
$ sudo ufw allow ssh
$ sudo ufw enable
$ sudo ufw status # check status to make sure you have ssh access