A script to automate the setup of a new Debian based operating system, tuned to my personal liking. Included are setup scripts for Debian based desktops, servers and sandboxed development VMs.
- Debian or Debian based operating system
- Gnome or Plasma is required for desktop usage
- Hardware virtualization (KVM) enabled for development VMs
- Access to terminal/shell where output is visible
- Terminal/shell user has sudo privileges
bash&curlmust be installed alreadygpgrecommended for signature verification- Working internet connection
Add xmready's PGP signing key to your keyring
gpg --keyserver "hkps://keys.openpgp.org" --recv-keys 17AF13F5D2F5013A
- Change working directory to
/tmp
cd /tmp
- Download
setup-desktop.shwith the checksums & signature from the latest release
curl --output-dir "$PWD" -fLO "https://github.com/xmready/setup-debian/releases/latest/download/{setup-desktop.sh,SHA256SUMS_DESKTOP,SHA256SUMS_DESKTOP.sign}"
- Verify the PGP signature
gpg --verify SHA256SUMS_DESKTOP.sign SHA256SUMS_DESKTOP
- Verify the checksum of
setup-desktop.shagainstSHA256SUMS_DESKTOP
sha256sum --ignore-missing -c SHA256SUMS_DESKTOP
- Run the setup script
chmod +x setup-desktop.sh && ./setup-desktop.sh
- Change working directory to
/tmp
cd /tmp
- Download
setup-server.shwith the checksums & signature from the latest release
curl --output-dir "$PWD" -fLO "https://github.com/xmready/setup-debian/releases/latest/download/{setup-server.sh,SHA256SUMS_SERVER,SHA256SUMS_SERVER.sign}"
- Verify the PGP signature
gpg --verify SHA256SUMS_SERVER.sign SHA256SUMS_SERVER
- Verify the checksum of
setup-server.shagainstSHA256SUMS_SERVER
sha256sum --ignore-missing -c SHA256SUMS_SERVER
- Run the setup script
chmod +x setup-server.sh && ./setup-server.sh
Run these on the desktop host after setup-desktop.sh has finished and the system has rebooted.
- Change working directory to
/tmp
cd /tmp
- Download
setup-dev.shwith the checksums & signature from the latest release
curl --output-dir "$PWD" -fLO "https://github.com/xmready/setup-debian/releases/latest/download/{setup-dev.sh,SHA256SUMS_DEV,SHA256SUMS_DEV.sign}"
- Verify the PGP signature
gpg --verify SHA256SUMS_DEV.sign SHA256SUMS_DEV
- Verify the checksum of
setup-dev.shagainstSHA256SUMS_DEV
sha256sum --ignore-missing -c SHA256SUMS_DEV
- Start the base VM created by
setup-desktop.sh, then wait untilincus listshows it with an IPv4 address
incus start dev-base
- Copy the verified files into the VM
incus file push --uid 1000 --gid 1000 setup-dev.sh SHA256SUMS_DEV dev-base/tmp/
- Log in to the VM as the
devuser
incus dev dev-base
- Run the setup script inside the VM
cd /tmp && chmod +x setup-dev.sh && ./setup-dev.sh
- After the VM reboots, snapshot it as the template for project VMs
incus snapshot create dev-base clean
- Create a VM for each project from the template
incus copy dev-base/clean proj-example
incus start proj-example
For Debian desktop systems setup-desktop.sh will do the following:
- Update & upgrade all deb packages with
apt-get - Install the following deb packages with
apt-get- bash-completion
- btop
- build-essential
- btrfs-progs
- checkinstall
- clamav
- clamav-daemon
- curl
- fastfetch
- ffmpeg
- flatpak
- fprintd
- fzf
- git
- gnupg
- incus
- libnotify-bin
- libpam-fprintd
- lm-sensors
- myrepos
- nmap
- pipx
- qrencode
- rename
- ripgrep
- rsync
- ssh-audit
- tmux
- ufw
- virt-viewer
- wget
- wl-clipboard
- Customize
.bashrcfor the current user- Increase
HISTSIZE&HISTFILESIZE - Customize prompt PS1
- Set
EDITOR=vim - Disable Flow Control
- Append current session's command history to the history file
- Read any new lines from the history file
- Set up fzf key bindings and fuzzy completion
- Increase
- Download
.tmux.conffiles to current user & root home directory - Enable fingerprint authentication
- Install Tor
- Add Tor repository
- Install
tor&deb.torproject.org-keyring - Disable
tor.servicefrom starting automatically
- Install Signal
- Add Signal repository
- Install
signal-desktop
- Install & configure Vim
- Install
vim-nox& YouCompleteMe dependencies, includingnodejs&npm - Install
ycm-compilescript in~/bin/ - Install custom
vimrcfor current user - Install custom
vimrcfor root user - Install custom template files in
~/.config/vim/templates/ - Install the following Nerd Fonts for current user
- DejaVuSansMono
- FiraCode
- Hack
- JetBrainsMono
- Install
- Install & configure Rclone
- Install latest
rcloneversion - Create directories for mounting Google Drive VFS
- Create directory
~/.config/rclone/ - Install systemd unit files for running
rcloneas a service
- Install latest
- Configure clamav
- Download configs and unit files
- Enable the following services:
clamav-clamonacc.serviceclamav-daemon.serviceclamav-freshclam.serviceclamdscan.timer
- Install GHCup
- Install latest
ghcupto current user - Install latest stable version of
cabal - Install the following
cabalpackages- kmonad
- Install latest
- Configure kmonad as systemd service
- Create config path
/etc/kmonad - Download config, udev and unit files
- Copy
kmonadbin file to/usr/local/bin - Update
config.kbdwith device file path - Reload udev rules and enable kmonad service
- Create config path
- Install verified Flatpak apps
- Firefox
- GIMP
- GnuCash
- Kdenlive
- KeePassXC
- Kleopatra
- qBittorrent
- Rnote
- Thunderbird
- Ungoogled Chromium
- Install & configure Incus for sandboxed development VMs
- Install
incusand add the current user to theincus-admingroup - Create the
sandboxbtrfs storage pool, as a subvolume on btrfs hosts or a sparse file on other filesystems - Create the
incusbr0network bridge - Give VMs from the
defaultprofile a 30 GiB disk and thesandboxfirewall rules - Block VMs from reaching the host, the local network and each other, while allowing internet access
- Allow VMs to reach the host only for DHCP and DNS with
ufw - Create the
dev-baseVM fromimages:debian/trixiewith half the host's CPUs and memory, up to 4 CPUs and 8 GiB - Add a
devuser with passwordless sudo todev-base
- Install
- Install custom commands in
~/bin/autoupgrade-desktop(requires sudo)dnsleaktestgdrive-backupgdrive-checkgdrive-resyncgdrive-startgdrive-statusgdrive-stoptemps
- Harden network security
- Disable tcp timestamps
- Set default firewall policy with
ufw - Enable
ufw
- Autoremove and clean packages using
apt-get - Reboot system after 10 minutes
For Debian server systems setup-server.sh will do the following:
- Update & upgrade all packages with
apt-get - Install the following packages with
apt-get- curl
- fail2ban
- fzf
- git
- gnupg
- lm-sensors
- openssh-server
- rsync
- screen
- tmux
- ufw
- vim
- Customize
.bashrcfor the current user- Increase
HISTSIZE&HISTFILESIZE - Customize prompt PS1
- Set
EDITOR=vim - Disable Flow Control
- Append current session's command history to the history file
- Read any new lines from the history file
- Set up fzf key bindings and fuzzy completion
- Increase
- Download
.tmux.conffiles to current user & root home directory - Configure Vim
- Install custom
vimrcfor current user - Install custom
vimrcfor root user
- Install custom
- Install custom commands in
/usr/local/bin/autoupgrade-server(requires sudo)dnsleaktesttemps
- Harden network security
- Disable tcp timestamps
- Set default firewall policy with
ufw - Allow incoming connections on port 22 with
ufw - Enable
ufw - Generate a new & strong ssh host key with
ssh-keygen - Install hardened ssh config file
- Autoremove and clean packages using
apt-get - Reboot system after 10 minutes
For Debian development VMs setup-dev.sh will do the following:
- Update & upgrade all packages with
apt-get - Install the following packages with
apt-get- bash-completion
- build-essential
- curl
- fzf
- git
- jq
- openssh-client
- ripgrep
- rsync
- tmux
- unzip
- vim-nox
- wget
- Customize
.bashrcfor the current user- Increase
HISTSIZE&HISTFILESIZE - Customize prompt PS1
- Set
EDITOR=vim - Disable Flow Control
- Append current session's command history to the history file
- Read any new lines from the history file
- Set up fzf key bindings and fuzzy completion
- Increase
- Download
.tmux.conffiles to current user & root home directory - Install & configure Vim
- Install
vim-nox - Install custom
vimrcfor current user - Install custom
vimrcfor root user - Install custom template files in
~/.config/vim/templates/
- Install
- Install Homebrew
- Install latest
brewversion to the current user - Update
.bashrcto addbrewto$PATH - Disable Homebrew analytics
- Install latest
- Install Node Version Manager
- Install latest
nvmversion to current user - Update
.bashrcto usenvmautomatically in directories with a.nvmrcfile - Install latest stable version of Node.js
- Creates the
nvmaliasdefaultwhich points to the latest stable release
- Install latest
- Install and configure OpenCode
- Install latest
opencodeversion to current user - Download
tui.jsonconfig file to~/.config/opencode/
- Install latest
- Install Claude Code
- Install latest
claudeversion to current user with the native installer
- Install latest
- Install custom commands in
~/bin/autoupgrade-dev(requires sudo)
- Autoremove and clean packages using
apt-get - Reboot system after 10 minutes