Prerequisite
Install
Create the CT
{
read -rs -p "Root password for the new CT: " PW; echo
pct create \
200 \
/mnt/pve/evo/template/cache/alpine-3.24-default_20260714_amd64.tar.xz \
--hostname samba \
--cores 1 \
--memory 128 \
--net0 name=eth0,bridge=vmbr0,firewall=1,gw=192.168.0.1,ip=192.168.0.200/24,hwaddr=DE:AD:DE:AD:02:00,type=veth \
--rootfs local-lvm:0.5 \
--mp0 /mnt/pve/evo/data,mp=/data \
--unprivileged 1 \
--ignore-unpack-errors \
--ostype alpine \
--password="$PW" \
--start 1
unset PW
}Enter the CT
pct enter 200Install Samba
apk update && apk upgrade
apk add sambaEdit the Samba config file
cat >> /etc/samba/smb.conf <<'EOF'
[storage]
comment = Network Shared Folder by Samba Server on Alpine
path = /data
force user = samba
force group = samba
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
read only = no
browseable = yes
EOFAfter configuring
mkdir -p /data
addgroup --system samba
adduser -G samba -H -D -s /sbin/nologin samba
chown -R samba:samba /data
chmod -R g+w /data
rc-update add samba default
rc-service samba start
service samba statusSamba password
smbpasswd -a sambaUpdate
Update Samba
apk upgrade samba
rc-service samba restartRemove
Delete the CT
pct stop 200
pct destroy 200