Server Initialization Guide

209 words
1 minute
Server Initialization Guide

Server Initialization Guide#

1. System Update#

Terminal window
apt update
apt upgrade -y

2. Security Hardening#

Change the SSH Port#

Edit the SSH config file /etc/ssh/sshd_config and change the default port 22:

Terminal window
vim /etc/ssh/sshd_config
# Find #Port 22, change to Port your-port
# Save and restart the service
systemctl restart ssh

Create a Non-root User#

Terminal window
# Create a new user
adduser your-username
# Install sudo
apt install sudo
# Add the user to the sudo group
usermod -aG sudo your-username
# Or edit /etc/sudoers to add:
# your-username ALL=(ALL) NOPASSWD: ALL

Disable Root Remote Login#

Terminal window
# In /etc/ssh/sshd_config, set:
PermitRootLogin no

SSH Key Authentication + Disable Passwords#

Terminal window
# Generate a key pair locally, then copy the public key to the server
ssh-copy-id your-username@your-server-ip
# In /etc/ssh/sshd_config:
PasswordAuthentication no
PubkeyAuthentication yes
# Restart the service
sudo systemctl restart ssh

3. Install Common Software#

Docker#

Refer to the official Docker documentation for installation.

Nginx Proxy Manager#

Install NPM via Docker for a web UI to manage reverse proxies and SSL certificates.

SSL Certificates#

Use acme.sh + Cloudflare DNS API to issue wildcard certificates with auto-renewal.

Internal Network Tunneling (frp)#

Use frp for internal network tunneling. Newer versions use TOML configuration.

Alist#

Multi-storage mounting tool with one-click Docker deployment. See Alist documentation for details.

Firewall#

  • Remember to allow the new SSH port in the firewall
  • Use iptables to mitigate SYN and CC attacks
  • Only expose necessary ports (80, 443, SSH, etc.)

Support & Share

If this article helped you, please share or support!

Sponsor
Server Initialization Guide
https://blog.zinzin.cc/posts/server-init-guide-en/
Author
gzdyj
Published at
2026-07-23
Profile Image of the Author
gzdyj
Code, life, and everything in between.
Announcement
Welcome to my blog! This is a sample announcement.
Categories
Tags
Latest Moments
Site Statistics
Posts
8
Categories
4
Tags
27
Total Words
13,116
Running Days
0 days
Last Activity
0 days ago
Site Info
Build Platform
GitHub Actions
Blog Version
Firefly v6.14.5
License
CC BY-NC-SA 4.0