Skip to main content
Community Scripts logo
Installation Scripts

Install scripts

What install/<app>-install.sh is, when it runs, and what the engine has prepared before its first line.

Every container script has a partner at install/<app>-install.sh in ProxmoxVE. The user never runs it. build_container fetches it on the host and executes it inside the new container as root. It installs the application and nothing else: the container already exists, has an address, and has curl, sudo, mc, gnupg2 and jq (Debian and Ubuntu) or bash, newt, curl, openssh, nano, mc, ncurses and jq (Alpine) installed.

The shape of a script

install/gotify-install.sh in full:

#!/usr/bin/env bash

# Copyright (c) 2021-2026 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://gotify.net/ | Github: https://github.com/gotify/server

source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

fetch_and_deploy_gh_release "gotify" "gotify/server" "prebuild" "latest" "/opt/gotify" "gotify-linux-$(arch_resolve).zip"
chmod +x /opt/gotify/gotify-linux-$(arch_resolve)

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/gotify.service
[Unit]
Description=Gotify
Requires=network.target
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/gotify
ExecStart=/opt/gotify/gotify-linux-$(arch_resolve) serve
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now gotify
msg_ok "Created Service"

motd_ssh
customize
cleanup_lxc
BlockLinesSame in every script
Bootstrapsource through update_osyes
Applicationdependencies, runtimes, databases, release, configuration, serviceno
Finishmotd_ssh, customize, cleanup_lxcyes

What the script can rely on

  • It runs as root inside the container, started by the host with lxc-attach.
  • FUNCTIONS_FILE_PATH holds the text of lxc/install.func. Sourcing it loads messaging, error handling and OS detection.
  • After update_os the helper library is loaded: lib/tools.func on every distribution except Alpine, which gets lib/alpine.func. Helpers such as fetch_and_deploy_gh_release or setup_nodejs do not exist before that call.
  • Exported variables of the container script arrive in the environment, among them APPLICATION (the APP value), app (NSAPP), PASSWORD, SSH_ROOT, CTTYPE, PCT_OSTYPE, PCT_OSVERSION, PCT_ARCH, var_ram and any var_* the container script exported itself.
  • LOCAL_IP holds the container's address.
  • A failing command stops the script. The error handler writes the exit code and the output of the failed step to files the host collects; the host shows the error and reports it.

Where to go next