A comprehensive guide for setting up and configuring Ubuntu Server 24.04 LTS (Noble Numbat) with dotfiles, Git, and automated updates.
Last Updated: October 2025
Ubuntu Server is widely adopted for production environments thanks to its stability, predictable release cycle, and strong community support. The Long Term Support (LTS) editions are particularly well-suited for production deployments, providing extended security and maintenance updates.
This repository provides everything you need to set up a fresh, clean configuration of a new Ubuntu Server—whether it's hosted in a home lab, on a VPS, or through a cloud provider—ensuring a secure and optimized foundation from the start.
- Automated Dotfiles Installation - Custom
.bashrc,.vimrc, and.gitconfigconfigurations - Git Setup Automation - Latest Git version installation from official PPA
- Security Hardening - SSH key setup and root login disabling
- Unattended Updates - Automatic security updates configuration
- Reference Documentation - Bash aliases and Vim keymapping cheatsheets
For a new Ubuntu Server installation, run these commands:
# 1. Update the system
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# 2. Install latest Git
curl -fsSL https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/install-git.sh | sudo bash
# 3. Install custom dotfiles (.bashrc, .vimrc, and .gitconfig)
curl -sSL https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/dotfiles.sh | bash
# 4. Customize your Git configuration
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
# 5. Reboot
sudo shutdown now -r- Overview
- Features
- Quick Start
- Installation
- User Management
- Dotfiles Setup
- Git Installation
- Automatic Updates
- Repository Contents
- Reference Documentation
Download and install Ubuntu Server from the official sources:
- Download: Ubuntu Server 24.04 LTS
- Installation Guide: Official Ubuntu Server Installation Tutorial
After installation, update the system packages:
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -yRestart your server to apply updates:
sudo shutdown now -rNote: This section applies primarily to cloud provider instances. On local server installations, the admin user is typically created during the installation process.
Create a new user:
adduser $USERNAMEAdd the user to the sudo group:
usermod -aG sudo $USERNAMESwitch to the new user:
su $USERNAMEVerify sudo access:
sudo cat /var/log/auth.logSet up SSH key authentication for the newly created user.
Switch to the new user and create the .ssh directory:
su $USERNAME
cd ~
mkdir -p ~/.ssh
chmod 700 ~/.sshFor Cloud Servers:
Create an authorized_keys file and add your public key:
vi ~/.ssh/authorized_keys
chmod 644 ~/.ssh/authorized_keysFor Local Servers:
Copy your public SSH key from your local machine:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-hostImportant: Before disabling root login, verify you can successfully SSH with the new user account.
Edit the SSH daemon configuration:
sudo vi /etc/ssh/sshd_configChange the following line:
PermitRootLogin yesTo:
PermitRootLogin noRestart the SSH service to apply changes:
sudo systemctl restart sshThe included dotfiles provide a lightweight, minimalist configuration designed to streamline everyday server administration and development tasks:
.bashrc- Custom bash aliases, functions, and prompt configuration- Includes the
svimalias (sudo -E vim) for editing system files with your personal nvim configuration preserved
- Includes the
.vimrc- Vim editor settings and keybindings.gitconfig- Pre-configured Git settings with useful aliases and defaults
Note: These dotfiles are optional but highly recommended. They include good practices and useful aliases and shortcuts for server administration and file editing that can significantly improve your productivity on the server.
Run the automated installation script:
curl -sSL https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/dotfiles.sh | bashThe script will:
- Backup your existing
.bashrc,.vimrc, and.gitconfigfiles to~/.dotfiles_backup/ - Keep only the last 3 versions of each file
- Download and install the new dotfiles
- Configure MOTD suppression for a cleaner login experience
After installation, customize your Git configuration:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"The installation script automatically suppresses the default Ubuntu welcome message. If you need to do this manually:
# Create .hushlogin (per-user)
touch ~/.hushlogin
# Disable dynamic MOTD scripts (system-wide)
sudo chmod -x /etc/update-motd.d/*
# Disable motd-news service
sudo systemctl disable motd-news.timer
sudo systemctl stop motd-news.timer
# Reload your .bashrc
source ~/.bashrcInstall the latest version of Git from the official PPA. See the complete Git setup guide for detailed instructions and configuration options.
curl -fsSL https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/install-git.sh | sudo bashsudo apt update
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y
git --versionNote: If you've already run the dotfiles.sh script, your .gitconfig is already installed. You just need to customize it with your information:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"If you didn't use the dotfiles script, you can download the .gitconfig template separately:
curl -fsSL https://raw.githubusercontent.com/orue/ubuntu-server-configuration/main/.gitconfig -o ~/.gitconfig
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Enable unattended security updates to keep your server secure automatically.
sudo apt install unattended-upgradesNote: This package is already installed on most Ubuntu systems.
sudo dpkg-reconfigure --priority=low unattended-upgradesThis will configure automatic installation of security updates while requiring manual approval for other updates.
This repository includes helpful reference guides:
- Bash Aliases Reference - Complete guide to custom bash aliases and functions
- Vim Keymapping Cheatsheet - Quick reference for custom vim keybindings
- Git Setup Guide - Detailed Git installation and configuration
