Last active
August 17, 2025 07:41
-
-
Save qualk/ce319db06b8b1b35549896f57e21547e to your computer and use it in GitHub Desktop.
Proxmox TS6 Alpine LXC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) | |
# Copyright (c) 2021-2025 community-scripts ORG | |
# Author: tremor021 (Slaviša Arežina) | |
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | |
# Source: https://teamspeak.com/en/ | |
APP="Teamspeak-6-Server" | |
var_tags="${var_tags:-voice;communication}" | |
var_cpu="${var_cpu:-1}" | |
var_ram="${var_ram:-512}" | |
var_disk="${var_disk:-2}" | |
var_os="${var_os:-debian}" | |
var_version="${var_version:-12}" | |
var_unprivileged="${var_unprivileged:-1}" | |
header_info "$APP" | |
variables | |
color | |
catch_errors | |
function update_script() { | |
header_info | |
check_container_storage | |
check_container_resources | |
if [[ ! -d /opt/teamspeak-server ]]; then | |
msg_error "No ${APP} Installation Found!" | |
exit | |
fi | |
# Get latest release from GitHub API | |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/teamspeak/teamspeak6-server/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")' | sed 's|/|-|g') | |
if [[ -z "$LATEST_RELEASE" ]]; then | |
msg_error "Failed to fetch latest release" | |
exit 1 | |
fi | |
if [[ "${LATEST_RELEASE}" != "$(cat ~/.teamspeak-server 2>/dev/null)" ]] || [[ ! -f ~/.teamspeak-server ]]; then | |
msg_info "Stopping Service" | |
systemctl stop teamspeak-server | |
msg_ok "Stopped Service" | |
msg_info "Updating ${APP}" | |
DOWNLOAD_URL="https://github.com/teamspeak/teamspeak6-server/releases/download/${LATEST_RELEASE//-/\%2F}/teamspeak-server_linux_amd64-${LATEST_RELEASE}.tar.bz2" | |
curl -fsSL "$DOWNLOAD_URL" -o ts6server.tar.bz2 || { | |
msg_error "Download failed" | |
exit 1 | |
} | |
tar -xf ts6server.tar.bz2 --strip-components=1 -C /opt/teamspeak-server | |
rm -f ts6server.tar.bz2 | |
chmod +x /opt/teamspeak-server/tsserver | |
echo "${LATEST_RELEASE}" > ~/.teamspeak-server | |
msg_ok "Updated $APP" | |
msg_info "Starting Service" | |
systemctl start teamspeak-server | |
msg_ok "Started Service" | |
msg_ok "Updated Successfully" | |
else | |
msg_ok "Already up to date" | |
fi | |
exit | |
} | |
function install_teamspeak() { | |
if [[ -d /opt/teamspeak-server ]]; then | |
return 0 | |
fi | |
# Get latest release | |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/teamspeak/teamspeak6-server/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")' | sed 's|/|-|g') | |
[[ -z "$LATEST_RELEASE" ]] && { msg_error "Failed to fetch latest release"; exit 1; } | |
msg_info "Installing ${APP} ${LATEST_RELEASE}" | |
DOWNLOAD_URL="https://github.com/teamspeak/teamspeak6-server/releases/download/${LATEST_RELEASE//-/\%2F}/teamspeak-server_linux_amd64-${LATEST_RELEASE}.tar.bz2" | |
curl -fsSL "$DOWNLOAD_URL" -o ts6server.tar.bz2 || { | |
msg_error "Download failed" | |
exit 1 | |
} | |
mkdir -p /opt/teamspeak-server | |
tar -xf ts6server.tar.bz2 --strip-components=1 -C /opt/teamspeak-server | |
rm ts6server.tar.bz2 | |
chmod +x /opt/teamspeak-server/tsserver | |
# Create systemd service | |
cat << EOF > /etc/systemd/system/teamspeak-server.service | |
[Unit] | |
Description=Teamspeak 6 Server | |
After=network.target | |
[Service] | |
WorkingDirectory=/opt/teamspeak-server | |
ExecStart=/opt/teamspeak-server/tsserver --accept-license | |
User=teamspeak | |
Group=teamspeak | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
# Create service user | |
useradd -r -s /bin/false teamspeak | |
chown -R teamspeak:teamspeak /opt/teamspeak-server | |
systemctl daemon-reload | |
systemctl enable --now teamspeak-server | |
echo "${LATEST_RELEASE}" > ~/.teamspeak-server | |
msg_ok "Installed ${APP}" | |
} | |
start | |
build_container | |
install_teamspeak | |
description | |
msg_ok "Completed Successfully!\n" | |
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" | |
echo -e "${INFO}${YW} Access it using the following URL:${CL}" | |
echo -e "${TAB}${GATEWAY}${BGN}${IP}:9987${CL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment