8000 GitHub - xmready/setup-debian: Setup scripts for a Debian desktop, server or development VM · GitHub
[go: up one dir, main page]

Skip to content

About

Setup scripts for a Debian desktop, server or development VM

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Debian

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.

Table of Contents

Requirements

  • 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 & curl must be installed already
  • gpg recommended for signature verification
  • Working internet connection

Usage

Import Signing Key

Add xmready's PGP signing key to your keyring

gpg --keyserver "hkps://keys.openpgp.org" --recv-keys 17AF13F5D2F5013A

Desktop Setup

  1. Change working directory to /tmp
cd /tmp
  1. Download setup-desktop.sh with 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}"
  1. Verify the PGP signature
gpg --verify SHA256SUMS_DESKTOP.sign SHA256SUMS_DESKTOP
  1. Verify the checksum of setup-desktop.sh against SHA256SUMS_DESKTOP
sha256sum --ignore-missing -c SHA256SUMS_DESKTOP
  1. Run the setup script
chmod +x setup-desktop.sh && ./setup-desktop.sh

Server Setup

  1. Change working directory to /tmp
cd /tmp
  1. Download setup-server.sh with 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}"
  1. Verify the PGP signature
gpg --verify SHA256SUMS_SERVER.sign SHA256SUMS_SERVER
  1. Verify the checksum of setup-server.sh against SHA256SUMS_SERVER
sha256sum --ignore-missing -c SHA256SUMS_SERVER
  1. Run the setup script
chmod +x setup-server.sh && ./setup-server.sh

Dev Setup

Run these on the desktop host after setup-desktop.sh has finished and the system has rebooted.

  1. Change working directory to /tmp
cd /tmp
  1. Download setup-dev.sh with 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}"
  1. Verify the PGP signature
gpg --verify SHA256SUMS_DEV.sign SHA256SUMS_DEV
  1. Verify the checksum of setup-dev.sh against SHA256SUMS_DEV
sha256sum --ignore-missing -c SHA256SUMS_DEV
  1. Start the base VM created by setup-desktop.sh, then wait until incus list shows it with an IPv4 address
incus start dev-base
  1. Copy the verified files into the VM
incus file push --uid 1000 --gid 1000 setup-dev.sh SHA256SUMS_DEV dev-base/tmp/
  1. Log in to the VM as the dev user
incus dev dev-base
  1. Run the setup script inside the VM
cd /tmp && chmod +x setup-dev.sh && ./setup-dev.sh
  1. After the VM reboots, snapshot it as the template for project VMs
incus snapshot create dev-base clean
  1. Create a VM for each project from the template
incus copy dev-base/clean proj-example
incus start proj-example

Setup Features

Desktop Setup Features

For Debian desktop systems setup-desktop.sh will do the following:

  1. Update & upgrade all deb packages with apt-get
  2. 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
  3. Customize .bashrc for 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
  4. Download .tmux.conf files to current user & root home directory
  5. Enable fingerprint authentication
  6. Install Tor
    • Add Tor repository
    • Install tor & deb.torproject.org-keyring
    • Disable tor.service from starting automatically
  7. Install Signal
    • Add Signal repository
    • Install signal-desktop
  8. Install & configure Vim
    • Install vim-nox & YouCompleteMe dependencies, including nodejs & npm
    • Install ycm-compile script in ~/bin/
    • Install custom vimrc for current user
    • Install custom vimrc for root user
    • Install custom template files in ~/.config/vim/templates/
    • Install the following Nerd Fonts for current user
      • DejaVuSansMono
      • FiraCode
      • Hack
      • JetBrainsMono
  9. Install & configure Rclone
    • Install latest rclone version
    • Create directories for mounting Google Drive VFS
    • Create directory ~/.config/rclone/
    • Install systemd unit files for running rclone as a service
  10. Configure clamav
    • Download configs and unit files
    • Enable the following services:
      • clamav-clamonacc.service
      • clamav-daemon.service
      • clamav-freshclam.service
      • clamdscan.timer
  11. Install GHCup
    • Install latest ghcup to current user
    • Install latest stable version of cabal
    • Install the following cabal packages
      • kmonad
  12. Configure kmonad as systemd service
    • Create config path /etc/kmonad
    • Download config, udev and unit files
    • Copy kmonad bin file to /usr/local/bin
    • Update config.kbd with device file path
    • Reload udev rules and enable kmonad service
  13. Install verified Flatpak apps
    • Firefox
    • GIMP
    • GnuCash
    • Kdenlive
    • KeePassXC
    • Kleopatra
    • qBittorrent
    • Rnote
    • Thunderbird
    • Ungoogled Chromium
  14. Install & configure Incus for sandboxed development VMs
    • Install incus and add the current user to the incus-admin group
    • Create the sandbox btrfs storage pool, as a subvolume on btrfs hosts or a sparse file on other filesystems
    • Create the incusbr0 network bridge
    • Give VMs from the default profile a 30 GiB disk and the sandbox firewall 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-base VM from images:debian/trixie with half the host's CPUs and memory, up to 4 CPUs and 8 GiB
    • Add a dev user with passwordless sudo to dev-base
  15. Install custom commands in ~/bin/
    • autoupgrade-desktop (requires sudo)
    • dnsleaktest
    • gdrive-backup
    • gdrive-check
    • gdrive-resync
    • gdrive-start
    • gdrive-status
    • gdrive-stop
    • temps
  16. Harden network security
    • Disable tcp timestamps
    • Set default firewall policy with ufw
    • Enable ufw
  17. Autoremove and clean packages using apt-get
  18. Reboot system after 10 minutes

Server Setup Features

For Debian server systems setup-server.sh will do the following:

  1. Update & upgrade all packages with apt-get
  2. Install the following packages with apt-get
    • curl
    • fail2ban
    • fzf
    • git
    • gnupg
    • lm-sensors
    • openssh-server
    • rsync
    • screen
    • tmux
    • ufw
    • vim
  3. Customize .bashrc for 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
  4. Download .tmux.conf files to current user & root home directory
  5. Configure Vim
    • Install custom vimrc for current user
    • Install custom vimrc for root user
  6. Install custom commands in /usr/local/bin/
    • autoupgrade-server (requires sudo)
    • dnsleaktest
    • temps
  7. 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
  8. Autoremove and clean packages using apt-get
  9. Reboot system after 10 minutes

Dev Setup Features

For Debian development VMs setup-dev.sh will do the following:

  1. Update & upgrade all packages with apt-get
  2. Install the following packages with apt-get
    • bash-completion
    • build-essential
    • curl
    • fzf
    • git
    • jq
    • openssh-client
    • ripgrep
    • rsync
    • tmux
    • unzip
    • vim-nox
    • wget
  3. Customize .bashrc for 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
  4. Download .tmux.conf files to current user & root home directory
  5. Install & configure Vim
    • Install vim-nox
    • Install custom vimrc for current user
    • Install custom vimrc for root user
    • Install custom template files in ~/.config/vim/templates/
  6. Install Homebrew
    • Install latest brew version to the current user
    • Update .bashrc to add brew to $PATH
    • Disable Homebrew analytics
  7. Install Node Version Manager
    • Install latest nvm version to current user
    • Update .bashrc to use nvm automatically in directories with a .nvmrc file
    • Install latest stable version of Node.js
    • Creates the nvm alias default which points to the latest stable release
  8. Install and configure OpenCode
    • Install latest opencode version to current user
    • Download tui.json config file to ~/.config/opencode/
  9. Install Claude Code
    • Install latest claude version to current user with the native installer
  10. Install custom commands in ~/bin/
    • autoupgrade-dev (requires sudo)
  11. Autoremove and clean packages using apt-get
  12. Reboot system after 10 minutes

About

Setup scripts for a Debian desktop, server or development VM

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0