Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions ct/iperf3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main"
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Leif Davisson (leifdavisson)
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://github.com/esnet/iperf

APP="iPerf3"
var_tags="${var_tags:-network;benchmark;iperf3}"
var_cpu="${var_cpu:-1}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"

if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
var_os=$(msg_menu "Choose the container OS" \
"debian" "Debian 13" \
"alpine" "Alpine (smaller footprint)")
fi

if [[ "${var_os:-}" == "alpine" ]]; then
var_ram="${var_ram:-256}"
var_disk="${var_disk:-1}"
var_version="${var_version:-3.24}"
else
var_os="${var_os:-debian}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-2}"
var_version="${var_version:-13}"
fi

header_info "$APP"
variables
color
catch_errors

update_deb_based() {
msg_info "Updating iPerf3"
$STD apt update
$STD apt upgrade -y
systemctl restart iperf3
msg_ok "Updated iPerf3"
}

update_alpine() {
msg_info "Updating iPerf3"
$STD apk -U upgrade
$STD rc-service iperf3 restart
msg_ok "Updated iPerf3"
}

function update_script() {
header_info
check_container_storage
check_container_resources
if ! command -v iperf3 >/dev/null 2>&1; then
msg_error "No ${APP} Installation Found!"
exit
fi
run_os_update
exit
}

start
build_container
description

msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}iPerf3 server is listening on port 5201:${CL}"
echo -e "${GATEWAY}${BGN}iperf3 -c ${IP}${CL}"
74 changes: 74 additions & 0 deletions install/iperf3-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env bash

# Copyright (c) 2021-2026 community-scripts ORG
# Author: Leif Davisson (leifdavisson)
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://github.com/esnet/iperf

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

setup_deb_based() {
msg_info "Installing iPerf3"
$STD apt install -y iperf3
msg_ok "Installed iPerf3"

msg_info "Creating Service"
cat <<'EOF' >/etc/systemd/system/iperf3.service
[Unit]
Description=iPerf3 Network Bandwidth Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=nobody
Group=nogroup
ExecStart=/usr/bin/iperf3 -s
Restart=on-failure
RestartSec=5

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

setup_alpine() {
msg_info "Installing iPerf3"
$STD apk add --no-cache iperf3
msg_ok "Installed iPerf3"

msg_info "Creating Service"
cat <<'EOF' >/etc/init.d/iperf3
#!/sbin/openrc-run
name="iPerf3"
description="iPerf3 Network Bandwidth Server"
command="/usr/bin/iperf3"
command_args="-s"
command_user="nobody:nobody"
command_background="yes"
pidfile="/run/iperf3.pid"

depend() {
need net
after firewall
}
EOF
chmod +x /etc/init.d/iperf3
$STD rc-update add iperf3 default
$STD rc-service iperf3 start
msg_ok "Created Service"
}

run_os_setup

motd_ssh
customize
cleanup_lxc
62 changes: 62 additions & 0 deletions json/iperf3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "iPerf3",
"slug": "iperf3",
"categories": [
4
],
"date_created": "2026-11-15",
"type": "ct",
"platforms": [
"pve"
],
"architectures": [
"amd64",
"arm64"
],
"updateable": true,
"privileged": false,
"interface_port": 5201,
"documentation": "https://software.es.net/iperf/",
"website": "https://software.es.net/iperf/",
"repository": "https://github.com/esnet/iperf",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/iperf3.webp",
"description": "iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. This container runs an always-on iperf3 server on TCP/UDP port 5201 for local LAN and Wi-Fi throughput benchmarking.",
"install_methods": [
{
"type": "default",
"script": "ct/iperf3.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 2,
"os": "Debian",
"version": "13"
}
},
{
"type": "alpine",
"script": "ct/iperf3.sh",
"resources": {
"cpu": 1,
"ram": 256,
"hdd": 1,
"os": "Alpine",
"version": "3.24"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Test TCP throughput from any client on your network with: iperf3 -c <CONTAINER_IP>",
"type": "info"
},
{
"text": "Test download (server-to-client) throughput with: iperf3 -c <CONTAINER_IP> -R",
"type": "info"
}
]
}
Loading