Skip to content

Sample setup 1

Fons van der Plas edited this page May 1, 2026 · 2 revisions

Part 1: setup and running locally

1. Initialize

Create a folder called pluto-deployment-environment with the Project.toml and Manifest.toml for the PlutoSliderServer: (Not the notebooks - the notebooks should contain their own package environment.)

$ cd <your-repository-with-notebooks>
$ mkdir pluto-deployment-environment
$ julia --project=pluto-deployment-environment
julia> ]
pkg> add Pluto PlutoSliderServer

2. Configuration file

Create a configuration file in the pluto-deployment-environment directory, which also contains a Project.toml file, see the section about PlutoDeployment.toml above.

TEMPFILE=$(mktemp)
cat > $TEMPFILE << __EOF__
[SliderServer]
port = 8080
host = "0.0.0.0"

# more configuration can go here!
__EOF__

sudo mv $TEMPFILE pluto-deployment-environment/PlutoDeployment.toml

This configuration sets the port to 8080 (not 80, this requires sudo), and the host to "0.0.0.0" (which allows traffic from outside the computer, unlike the default "127.0.0.1").

3. Run it

Let's try running it locally before setting up our server:

julia --project="pluto-deployment-environment" -e "import PlutoSliderServer; PlutoSliderServer.run_git_directory(\".\")"

run_git_directory will periodically call git pull, which requires the start_dir to be a repository in which you can git pull without password (which means it's either public, or you have the required keys in ~/.ssh/ and your git's provider security page!)

Note Julia by default uses libgit2 for git operations, which can be problematic. It is also known to cause issues in cloud environments like AWS's CodeCommit where re-authentication is required at regular intervals.

A simple workaround is to set the JULIA_PKG_USE_CLI_GIT environment variable to true, which will fallback to the system git (the one on the shell). Make sure that this is installed! (sudo apt-get install git does the trick in Ubuntu).

Also note that git pull may fail on the server if you force push the branch from your laptop, so handle history-rewriting commands, like git push -f, git rebase etc with care!

Clone this wiki locally