Skip to content
This repository was archived by the owner on Jun 7, 2026. It is now read-only.

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Server Init

Archived server bootstrap script for Debian and Ubuntu VPS instances. This repository is kept as a practical shell-script reference, not as a live hosting recommendation page.

linux-server-init is a small set of scripts for preparing a new Linux VPS: package updates, basic tools, UFW firewall, SSH hardening, fail2ban, optional swap and optional TCP BBR.

For current maintained VPS tools and notes, start here:

Need Maintained Resource
General VPS tools and server resources awesome-vps-tools
BandwagonHost / 搬瓦工 speed test and datacenter notes bwg-speed-test
中文搬瓦工套餐、库存和购买前判断 BWH Guide

What It Does

  • Updates Debian/Ubuntu packages.
  • Installs common CLI tools such as htop, vim, curl, git, wget, tmux and ncdu.
  • Sets the server timezone.
  • Enables UFW and opens SSH, HTTP and HTTPS.
  • Applies basic SSH hardening.
  • Installs and configures fail2ban for SSH.
  • Adds swap automatically for low-memory servers.
  • Enables TCP BBR when supported by the kernel.

Safety First

Shell bootstrap scripts can lock you out of a server if they change SSH, firewall or network settings incorrectly. Before running this script on a real VPS:

  1. Open a second SSH session and keep it connected.
  2. Confirm your SSH port, firewall rules and provider console access.
  3. Review init.sh before running it.
  4. Make sure you have a working SSH key before disabling password login manually.
  5. Test on a fresh disposable server before using it on production.

Avoid running remote scripts blindly with curl | bash unless you have reviewed the script and trust the source.

Quick Start

Recommended: clone or download the repository first, then run the script locally:

git clone https://github.com/devguoo/linux-server-init.git
cd linux-server-init
bash init.sh --timezone Asia/Shanghai --ssh-port 22

Historical one-line usage:

curl -sL https://raw.githubusercontent.com/devguoo/linux-server-init/main/init.sh | bash

For custom options:

bash init.sh --timezone Asia/Shanghai --ssh-port 22222
bash init.sh --no-swap
bash init.sh --no-bbr

Options

Option Default Description
--timezone Asia/Shanghai Server timezone.
--ssh-port 22 SSH port to allow and configure.
--no-swap disabled Skip swap creation.
--no-bbr disabled Skip BBR setup.

Standalone Scripts

# Create a 2GB swap file
bash scripts/setup-swap.sh 2

# Enable TCP BBR
bash scripts/setup-bbr.sh

Configuration Samples

  • configs/sshd_config - SSH hardening example.
  • configs/jail.local - fail2ban SSH jail example.

Apply samples manually only after checking whether they fit your server:

cp configs/sshd_config /etc/ssh/sshd_config
cp configs/jail.local /etc/fail2ban/jail.local
systemctl restart sshd fail2ban

Supported Systems

The scripts were written for:

  • Debian 11 / 12
  • Ubuntu 20.04 / 22.04 / 24.04
  • Root shell access

They may need adjustments for newer distributions or providers with custom images.

Repository Status

This repository is archived in practice:

  • No live VPS pricing or provider ranking is maintained here.
  • No direct affiliate or referral links are included here.
  • New VPS tooling and resource updates should go to awesome-vps-tools.

License

MIT

About

[Archived] Historical Linux VPS bootstrap script; current resources moved to awesome-vps-tools.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages