JupyterLite extension to connect to a remote Jupyter server
Project description
jupyterlite-remote-server
A JupyterLite extension that connects to a remote Jupyter server for all services (kernels, contents, settings, etc.).
This extension replaces JupyterLite's in-browser service implementations with standard JupyterLab service managers that communicate with a remote Jupyter server. This allows you to run a static JupyterLite frontend while using a real Jupyter server for all backend operations.
How It Works
The extension provides ServiceManagerPlugins that:
- Disable JupyterLite's in-browser service implementations
- Provide standard JupyterLab service managers configured to connect to a remote server
- Read server connection settings dynamically from PageConfig
Configuration
Configure the extension by setting these options in jupyter-lite.json:
| Option | Description |
|---|---|
remoteBaseUrl |
The base URL of the remote Jupyter server (e.g., http://localhost:8888/) |
remoteToken |
The authentication token for the remote server |
appendToken |
Whether to append token to WebSocket URLs. If not set, auto-detects based on whether the base URL and WebSocket URL are on the same host |
Usage with JupyterLite
1. Start the Jupyter Server
Start a Jupyter server with CORS enabled to allow connections from JupyterLite:
jupyter server --ServerApp.token=my-token --ServerApp.allow_origin='*'
2. Create JupyterLite Configuration
Create a jupyter-lite.json configuration file:
{
"jupyter-lite-schema-version": 0,
"jupyter-config-data": {
"remoteBaseUrl": "http://localhost:8888/",
"remoteToken": "my-token",
"disabledExtensions": [
"@jupyterlite/services-extension:config-section-manager",
"@jupyterlite/services-extension:default-drive",
"@jupyterlite/services-extension:event-manager",
"@jupyterlite/services-extension:exporters",
"@jupyterlite/services-extension:kernel-manager",
"@jupyterlite/services-extension:kernel-client",
"@jupyterlite/services-extension:kernel-spec-client",
"@jupyterlite/services-extension:kernel-spec-manager",
"@jupyterlite/services-extension:kernel-specs",
"@jupyterlite/services-extension:localforage",
"@jupyterlite/services-extension:nbconvert-manager",
"@jupyterlite/services-extension:session-manager",
"@jupyterlite/services-extension:settings",
"@jupyterlite/services-extension:user-manager",
"@jupyterlite/services-extension:workspace-manager"
]
}
}
3. Build and Serve JupyterLite
# Install JupyterLite and this extension
pip install jupyterlite-core jupyterlite-remote-server
# Build the JupyterLite site
jupyter lite build
# Serve the built site
cd _output
python -m http.server 8000
Then open http://localhost:8000/lab/ in your browser.
See the demo/ directory for a complete example configuration.
Plugins Provided
This extension provides the following ServiceManagerPlugins:
| Plugin | Token | Description |
|---|---|---|
server-settings |
IServerSettings |
Remote server connection settings |
default-drive |
IDefaultDrive |
Server-connected file drive |
contents-manager |
IContentsManager |
File contents management |
kernel-manager |
IKernelManager |
Kernel lifecycle management |
kernel-spec-manager |
IKernelSpecManager |
Kernel specifications with URL rewriting |
session-manager |
ISessionManager |
Session management |
setting-manager |
ISettingManager |
User settings management |
workspace-manager |
IWorkspaceManager |
Workspace persistence |
user-manager |
IUserManager |
User information |
event-manager |
IEventManager |
Server events |
config-section-manager |
IConfigSectionManager |
Config section management |
nbconvert-manager |
INbConvertManager |
Notebook conversion |
terminal-manager |
ITerminalManager |
Terminal sessions |
Requirements
- JupyterLab >= 4.0.0
- A running Jupyter server with CORS enabled
Install
pip install jupyterlite-remote-server
Uninstall
pip uninstall jupyterlite-remote-server
Contributing
Development install
# Clone the repo and change to the directory
git clone https://github.com/jtpio/jupyterlite-remote-server.git
cd jupyterlite-remote-server
# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate
# Install in development mode
pip install --editable "."
jupyter labextension develop . --overwrite
# Rebuild after making changes
jlpm build
Development with watch mode
# Watch the source directory (in one terminal)
jlpm watch
# Run JupyterLab (in another terminal)
jupyter lab
Development uninstall
pip uninstall jupyterlite_remote_server
Then remove the symlink from jupyter labextension list location named jupyterlite-remote-server.
Packaging
See RELEASE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyterlite_remote_server-0.1.2.tar.gz.
File metadata
- Download URL: jupyterlite_remote_server-0.1.2.tar.gz
- Upload date:
- Size: 83.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
334acc8ce97f75d570ff7e4f2ab08dbb353296e6a32ea429c4f5a78b799f8624
|
|
| MD5 |
494525057673ed3f9f457711c7cf3b4d
|
|
| BLAKE2b-256 |
3936ab12c5c896d81d9f959cfceabf4bd34b53f9e36e343949a8854e902be860
|
File details
Details for the file jupyterlite_remote_server-0.1.2-py3-none-any.whl.
File metadata
- Download URL: jupyterlite_remote_server-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f75c3ad6d97a7b1fecbc8d385f46630eae6a425d1ad8dab4a8b6c0be1f772388
|
|
| MD5 |
6f0dc279a3741b7a7259be2feb2eecac
|
|
| BLAKE2b-256 |
846b3c6484e7ff6992ec51bf0831a6dcc97e6078af847692836f13754e0c848c
|