1. Why Install a Linux Server?¶
Linux servers are widely used by enterprises and developers for their stability and efficiency. Compared to Windows servers, they offer better security, lower resource consumption, and are well-suited for high-concurrency tasks. For beginners, mastering Linux installation is the first step toward server operations.
2. Pre-Installation Preparation¶
2.1 Choose Installation Scenario¶
-
Scenario 1: Local Virtual Machine Installation (For practice, requires idle computer resources)
Required: Computer (dual-core CPU+, 4G+ RAM), Virtualization software (VirtualBox or VMware, VirtualBox recommended for free use), Linux ISO image (Ubuntu Server LTS recommended for newbies). -
Scenario 2: Cloud Server Installation (For actual deployment, use cloud providers’ servers directly)
Required: Cloud platform account (Aliyun, Tencent Cloud, AWS, etc.), Budget (entry-level instance for newbies), IP address and remote login credentials.
2.2 Choose Linux Distribution¶
- Ubuntu Server: User-friendly, rich software sources, ideal for quick start. Minimal installation ~100MB.
- CentOS/Rocky Linux: Enterprise-grade stability, slightly complex for beginners.
- Newbie Recommendation: This guide uses Ubuntu Server 22.04 LTS (steps are general; adjust for other distributions).
3. Local Virtual Machine Installation (VirtualBox Example)¶
3.1 Install Virtualization Software¶
- Download VirtualBox from official website, follow installation prompts (Windows users: disable antivirus during installation).
3.2 Prepare Ubuntu Server ISO Image¶
- Download from Ubuntu’s official server ISO: https://ubuntu.com/download/server, select “Ubuntu Server 22.04 LTS”.
3.3 Start Ubuntu Server Installation¶
-
Step 1: Create Virtual Machine
Open VirtualBox → Click “New” → Enter name (e.g., “Ubuntu Server”) → Memory: 2048MB (2G) → Virtual hard disk: “Create new” → VDI (default) → Dynamically allocated (space-saving) → 20GB (sufficient for newbies). -
Step 2: Mount ISO Image
Select the new VM → “Settings” → “Storage” → Add CD in “Controller: IDE” → Choose downloaded ISO file → Start VM.
3.4 Enter Installation Interface¶
- VM starts → Select “Ubuntu Server” → Press Enter → Language: English (or Chinese for beginners) → Keyboard layout: English (US) → Installation type: “Ubuntu Server” (minimal, recommended for servers).
3.5 Critical Settings (Newbies Must See)¶
- Partitioning: Choose “Use an entire disk” (auto-partition) → Next (no complex partitions needed for servers).
- User Settings:
- Server name (e.g., “my-server”).
- Username (e.g., “ubuntu”) and password (remember for login).
- Check “Install OpenSSH server” (MUST for remote access).
- Network Configuration: Default “Done” (VM uses bridged network for auto-connectivity; check bridge mode if offline).
3.6 Wait for Installation Completion¶
- Installation takes 5-10 minutes → Click “Reboot Now” → Enter username/password post-reboot to access the system.
4. Cloud Server Installation (Aliyun Example)¶
4.1 Purchase Cloud Server Instance¶
- Log into Aliyun Console → “Elastic Compute Service (ECS)” → “Instances” → “Create Instance” → Image: “Ubuntu Server 22.04 LTS” → Specification: 1-core 2G (entry-level) → Instance name (e.g., “my-first-server”) → Login credential (password or key; key recommended for security).
4.2 Remote Connect to Cloud Server¶
- After creation, get public IP → Use local terminal (Windows: Putty/Xshell; Mac/Linux: built-in terminal):
ssh username@public-ip # Example: ssh ubuntu@123.45.67.89
- Enter password/key to access the server.
5. Post-Installation Verification¶
5.1 Check System Information¶
- Run command:
lsb_release -a(Ubuntu) orcat /etc/os-release(all distros) to verify OS version.
5.2 Test Network Connectivity¶
- Run
ping www.baidu.com→ “64 bytes” response indicates normal network.
5.3 Test User Permissions¶
- Execute
sudo apt updatewith regular user → No password required (correct sudo setup).
6. Newbies’ Must-Know Tips¶
- Password Security: Avoid simple passwords; use SSH keys (upload public key in cloud console).
- VM Network: If offline, set “Bridged Adapter” (right-click VM → Settings → Network → Bridged Adapter).
- Essential Tools: Install basic utilities post-install:
sudo apt install vim net-tools # Vim editor, network tools
7. Summary¶
Linux server installation is straightforward with step-by-step execution. Key points: minimal installation, remote access, and permission management. Practice basic commands (ls, cd, mkdir) post-installation. For issues, refer to Ubuntu Help.
Happy exploring Linux servers! Feel free to leave questions below.