Skip to content

AYJAYY/fresh-install-ubuntu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fresh Install Script - Ubuntu Server

version license

"Top things you need to do after installing Ubuntu Server!" - All in one script! - MUST HAVE!

Medium Article

Overview

This bash script is designed to automate the process of setting up and securing a fresh Ubuntu-based server system. It performs a series of tasks including updating the system, installing essential packages, configuring Git, setting up SSH with enhanced security measures, configuring the UFW firewall and fail2ban for improved system protection, creating useful bash aliases, and performing system cleanup.

Usage

Quick Method

  • bash <(curl -s https://raw.githubusercontent.com/AYJAYY/fresh-install-ubuntu/main/fiu.sh)1

Alternative Method

  • wget https://raw.githubusercontent.com/AYJAYY/fresh-install-ubuntu/main/fiu.sh
  • chmod +x ./fiu.sh
  • Run as non-root user
    • ./fiu.sh

Key Components

Initial Checks

  • Verifies the script is not run as root
  • Verifies the OS is Ubuntu-based

System Updates and Software Installation

  • Performs system updates (apt-get update, upgrade, dist-upgrade, snap refresh)
  • Installs a variety of useful software packages
    • btop,build-essential,bwm-ng,cockpit,curl,ecryptfs-utils,fail2ban,flatpak,gettext,git-all,googler,gparted,htop,iftop,iotop,libcurl4-gnutls-dev,libexpat1-dev,libssl-dev,libz-dev,net-tools,nmap,openssh-client,openssh-server,p7zip-full,p7zip-rar,python3,python3-pip,samba,snap,speedtest-cli,ssh,sysstat,thefuck,unattended-upgrades,unrar,vnstat,yt-dlp
  • Adds and installs additional repositories (fastfetch)

GitHub Configuration

  • Prompts for GitHub username and email
  • Configures git globally if information is provided

SSH Security Configuration

  • Modifies SSH configuration for improved security
  • Disables forwarding, root login, and ignores rhosts

Firewall Setup

  • Enables and configures UFW (Uncomplicated Firewall)
  • Opens specific ports (HTTP, Samba, SSH, 9090, 8112)

fail2ban Installation and Configuration

  • Installs and configures fail2ban for SSH protection

Bash Customization

  • Creates numerous aliases for common tasks, including:

    • System management (updates, cleaning)
    • File operations
    • Git commands
    • YouTube downloading
  • Stores these aliases in a file in the same directory as the script

  • Adds fastfetch to bash startup

System Cleanup

  • Performs system cleanup operations (autoclean, clean)

Security Measures

  • Enforces non-root user usage
  • Secures SSH configuration (Also Disables Password Login)
  • Enables and configures firewall
  • Implements fail2ban for brute-force protection

User Experience Enhancements

  • Adds various quality-of-life aliases
  • Improves terminal startup with fastfetch

Inspired By: The thousands of blog posts that come around each release cycle of Ubuntu on things to do on a fresh install. Examples: Tutorials Point Article | Steemit Article

Based on the legendary - First Ten Seconds by TedLeRoy, which was inspired by Jerry Gamblin's post: My First Ten Seconds on a Server by Jerry Gamblin

Footnotes

  1. Given that many individuals hesitate to curl content straight into bash, we advise utilizing the alternative method and inspecting the source code to validate the commands being executed.

About

"Things you need to do after installing Ubuntu Server" - All in one script!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages