Site Overlay

Ubuntu Server Initial Setup and Configuration Guide

Ubuntu Server Initial Setup and Configuration Guide
Ubuntu Logo

Ubuntu Server Initial Setup and Configuration Guide

Performing basic configurations on a newly installed Ubuntu server is crucial for system security and stability. In this guide, you will find steps for static IP, hostname, hosts file, updates, and installing essential packages.

🔄 1. System Updates

First, make sure your system is up to date:

sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y

🌐 2. Set Hostname

Set the server hostname with the following command:

sudo hostnamectl set-hostname panel.arifakyuz.com

📁 3. Edit Hosts File

Map the hostname to its IP address:

sudo nano /etc/hosts

Add or edit the following lines:

127.0.0.1       localhost
10.128.196.95   panel.arifakyuz.com panel

📡 4. Configure Static IP Address

Use ip a command to find your network interface name. Then edit the netplan configuration:

sudo nano /etc/netplan/50-cloud-init.yaml

Example configuration:

network:
  version: 2
  ethernets:
    ens18:  # ← Check your interface name!
      dhcp4: no
      addresses:
        - 10.128.196.250/24
      gateway4: 10.128.196.1
      nameservers:
        addresses:
          - 8.8.8.8

Apply the configuration:

sudo netplan apply

📦 5. Install Basic Packages

Install necessary basic tools:

sudo apt install net-tools
sudo apt install -y curl wget sudo

♻️ 6. Restart Services

After configuration, restart web services:

sudo systemctl restart apache2
sudo systemctl restart nginx

✅ Conclusion

Your Ubuntu server is now running with a static IP, a defined hostname, and essential software installed. This setup will make your server more stable and easier to manage.

arif akyuz
Arif Akyüz

image
Başka cihazda görüntüle
Arif Akyüz Sistem Network Yöneticisi ve Siber Güvenlik Uzmanı
Arif Akyüz Sistem Network Yöneticisi ve Siber Güvenlik Uzmanı

Arif Akyüz
Bilgi Teknolojileri
Sistem Network Yöneticisi
ve Siber Güvenlik Uzmanı
[email protected]

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors