Skip to content

Commit c8c23ca

Browse files
Livebook (#8739)
* 'Add new script' * chore refactor --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Tobias <[email protected]>
1 parent f7ec037 commit c8c23ca

File tree

4 files changed

+216
-0
lines changed

4 files changed

+216
-0
lines changed

ct/headers/livebook

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__ _ __ __
2+
/ / (_) _____ / /_ ____ ____ / /__
3+
/ / / / | / / _ \/ __ \/ __ \/ __ \/ //_/
4+
/ /___/ /| |/ / __/ /_/ / /_/ / /_/ / ,<
5+
/_____/_/ |___/\___/_.___/\____/\____/_/|_|
6+

ct/livebook.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/refs/heads/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: dkuku
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/livebook-dev/livebook
7+
8+
APP="Livebook"
9+
var_tags="${var_tags:-development}"
10+
var_disk="${var_disk:-4}"
11+
var_cpu="${var_cpu:-2}"
12+
var_ram="${var_ram:-1024}"
13+
var_os="${var_os:-ubuntu}"
14+
var_version="${var_version:-24.04}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
if check_for_gh_release "livebook" "livebook-dev/livebook"; then
33+
msg_info "Stopping Service"
34+
systemctl stop livebook
35+
msg_info "Stopped Service"
36+
37+
msg_info "Updating Container"
38+
$STD apt update
39+
$STD apt upgrade -y
40+
msg_ok "Updated Container"
41+
42+
msg_info "Updating Livebook"
43+
source /opt/livebook/.env
44+
cd /opt/livebook
45+
$STD mix escript.install hex livebook --force
46+
47+
chown -R livebook:livebook /opt/livebook /data
48+
49+
msg_info "Starting Service"
50+
systemctl start livebook
51+
msg_info "Started Service"
52+
53+
msg_ok "Updated Successfully!"
54+
fi
55+
exit
56+
}
57+
58+
start
59+
build_container
60+
description
61+
62+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
63+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
64+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

frontend/public/json/livebook.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Livebook",
3+
"slug": "livebook",
4+
"categories": [
5+
20
6+
],
7+
"date_created": "2025-10-30",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8080,
12+
"documentation": "https://hexdocs.pm/livebook/readme.html",
13+
"config_path": null,
14+
"website": "https://livebook.dev",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/livebook.webp",
16+
"description": "Elixir Livebook is an interactive, web-based notebook platform for Elixir that combines code, documentation, and visualizations in a single document. Similar to Jupyter notebooks, it allows developers to write and execute Elixir code in real-time, making it ideal for data exploration, prototyping, learning, and collaborative development. Livebook features rich markdown support, built-in charting capabilities, and seamless integration with the Elixir ecosystem.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/livebook.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 1024,
24+
"hdd": 4,
25+
"os": "Ubuntu",
26+
"version": "24.04"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Show initial Livebook password: `cat ~/livebook.creds`",
37+
"type": "info"
38+
}
39+
]
40+
}

install/livebook-install.sh

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: dkuku
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/livebook-dev/livebook
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
build-essential \
19+
ca-certificates \
20+
cmake \
21+
git \
22+
libncurses5-dev
23+
msg_ok "Installed Dependencies"
24+
25+
msg_info "Creating livebook user"
26+
mkdir -p /opt/livebook /data
27+
export HOME=/opt/livebook
28+
$STD adduser --system --group --home /opt/livebook --shell /bin/bash livebook
29+
msg_ok "Created livebook user"
30+
31+
msg_warn "WARNING: This script will run an external installer from a third-party source (https://elixir-lang.org)."
32+
msg_warn "The following code is NOT maintained or audited by our repository."
33+
msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:"
34+
msg_custom "${TAB3}${GATEWAY}${BGN}${CL}" "\e[1;34m" "→ https://elixir-lang.org/install.sh"
35+
echo
36+
read -r -p "${TAB3}Do you want to continue? [y/N]: " CONFIRM
37+
if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
38+
msg_error "Aborted by user. No changes have been made."
39+
exit 10
40+
fi
41+
curl -fsSO https://elixir-lang.org/install.sh
42+
$STD sh install.sh elixir@latest otp@latest
43+
44+
msg_info "Setup Erlang and Elixir"
45+
ERLANG_VERSION=$(ls /opt/livebook/.elixir-install/installs/otp/ | head -n1)
46+
ELIXIR_VERSION=$(ls /opt/livebook/.elixir-install/installs/elixir/ | head -n1)
47+
LIVEBOOK_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16)
48+
49+
export ERLANG_BIN="/opt/livebook/.elixir-install/installs/otp/$ERLANG_VERSION/bin"
50+
export ELIXIR_BIN="/opt/livebook/.elixir-install/installs/elixir/$ELIXIR_VERSION/bin"
51+
export PATH="$ERLANG_BIN:$ELIXIR_BIN:$PATH"
52+
53+
$STD mix local.hex --force
54+
$STD mix local.rebar --force
55+
$STD mix escript.install hex livebook --force
56+
57+
cat <<EOF >/opt/livebook/.env
58+
export HOME=/opt/livebook
59+
export ERLANG_VERSION=$ERLANG_VERSION
60+
export ELIXIR_VERSION=$ELIXIR_VERSION
61+
export LIVEBOOK_PORT=8080
62+
export LIVEBOOK_IP="::"
63+
export LIVEBOOK_HOME=/data
64+
export LIVEBOOK_PASSWORD="$LIVEBOOK_PASSWORD"
65+
export ESCRIPTS_BIN=/opt/livebook/.mix/escripts
66+
export ERLANG_BIN="/opt/livebook/.elixir-install/installs/otp/\${ERLANG_VERSION}/bin"
67+
export ELIXIR_BIN="/opt/livebook/.elixir-install/installs/elixir/\${ELIXIR_VERSION}/bin"
68+
export PATH="\$ESCRIPTS_BIN:\$ERLANG_BIN:\$ELIXIR_BIN:\$PATH"
69+
EOF
70+
{
71+
echo "Livebook-Credentials"
72+
echo "Livebook Password: $LIVEBOOK_PASSWORD"
73+
} >>~/livebook.creds
74+
msg_ok "Installed Erlang $ERLANG_VERSION and Elixir $ELIXIR_VERSION"
75+
76+
msg_info "Installing Livebook"
77+
cat <<EOF >/etc/systemd/system/livebook.service
78+
[Unit]
79+
Description=Livebook
80+
After=network.target
81+
82+
[Service]
83+
Type=exec
84+
User=livebook
85+
Group=livebook
86+
WorkingDirectory=/data
87+
EnvironmentFile=-/opt/livebook/.env
88+
ExecStart=/bin/bash -c 'source /opt/livebook/.env && cd /opt/livebook && livebook server'
89+
Restart=always
90+
RestartSec=5
91+
92+
[Install]
93+
WantedBy=multi-user.target
94+
EOF
95+
chown -R livebook:livebook /opt/livebook /data
96+
systemctl enable -q --now livebook
97+
msg_ok "Installed Livebook"
98+
99+
motd_ssh
100+
customize
101+
102+
msg_info "Cleaning Up"
103+
$STD apt autoremove -y
104+
$STD apt autoclean -y
105+
$STD apt clean -y
106+
msg_ok "Cleaned Up"

0 commit comments

Comments
 (0)