- 1 1. Introduction
- 2 2. Updating the System
- 3 3. Setting Up the Japanese Environment
- 4 4. Setting the Timezone and Locale
- 5 5. Keyboard Configuration
- 6 6. Configuring the Firewall
- 7 7. Configuring the SSH Server
- 8 8. Installing Software
- 9 9. Configuring Automatic Updates
- 10 10. FAQ (Frequently Asked Questions)
- 10.1 Q1: Do I need to reboot after initial configuration?
- 10.2 Q2: Japanese input is not working. What should I do?
- 10.3 Q3: The Ubuntu timezone is incorrect. How can I fix it?
- 10.4 Q4: SSH connection fails (or is refused). What should I check?
- 10.5 Q5: Software installation fails with “Unable to locate package”. Why?
- 10.6 Q6: How can I check if UFW firewall rules are applied correctly?
- 10.7 Q7: The system behaves strangely after updates. What should I do?
- 10.8 Q8: I want to reduce disk usage in Ubuntu. How can I clean up the system?
- 11 Summary
1. Introduction
Ubuntu is one of the most widely used Linux distributions, suitable for beginners and advanced users alike. Its open-source nature and strong community support make it especially appealing. However, immediately after installation, the system may not be fully optimized for comfortable use, and several basic initial settings are required.
This article provides a detailed explanation of the essential configuration steps you should perform after installing Ubuntu. Each step is explained clearly, including the purpose of the setting and how to run the necessary commands, so even beginners can follow along without confusion.
Why You Should Configure Ubuntu After Installation
Right after installing Ubuntu, some areas may lack convenience or security. Common issues include:
- System updates are required: The packages included in the installation media may not be the latest, so updates are necessary for security and bug fixes.
- Japanese language support is incomplete: Since English is set as the default language, additional setup is needed to enable smooth Japanese input and display.
- Security settings are not optimized: Without configuring the firewall or SSH properly, risks of unauthorized access increase.
- Lack of essential software: The default installation includes only minimal applications, so you may need to install commonly used software.
Who This Article Is For
This guide is designed for users who:
- Are installing Ubuntu for the first time
- Are not yet comfortable using Linux commands
- Want a more secure and convenient Ubuntu environment
By following each section step-by-step, you’ll have a smooth and efficient Ubuntu setup process.
The next section explains how to update Ubuntu packages to their latest versions.
2. Updating the System
Immediately after installing Ubuntu, the included software packages may not be up to date. Updating the system is essential to prevent security vulnerabilities and ensure stability.
Why System Updates Are Necessary
Ubuntu installation media contains packages from the release date. Without updating, the following risks may occur:
- Remaining security vulnerabilities: Older packages may contain exploits attackers can target.
- Exposure to unresolved bugs: Bug fixes applied after the release will not be reflected.
- Compatibility issues: New software may fail to install due to outdated dependencies.
Updating the Package List
Ubuntu uses APT (Advanced Package Tool) to manage software packages. First, update the package list:
sudo apt updateUpgrading Packages
After updating the list, upgrade all installed packages:
sudo apt upgrade -yRemoving Unnecessary Packages (Recommended)
sudo apt autoremove -yRebooting the System (If Required)
sudo reboot3. Setting Up the Japanese Environment
By default, Ubuntu is configured for English. To use Japanese comfortably, you must install language packs and configure Japanese input.
Installing the Japanese Language Pack
1. Install the Japanese language pack
sudo apt install language-pack-ja -y2. Set the system language to Japanese
LANG=ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8Reboot to apply:
sudo rebootSetting Up Japanese Input (Mozc)
Ubuntu does not enable Japanese input by default, so an input method (IME) must be installed.
Recommended IME:
- Mozc (open-source Google Japanese Input)
1. Install Mozc
sudo apt install fcitx-mozc -y2. Switch input method to Fcitx
im-config -n fcitxReboot:
sudo reboot3. Configure Fcitx
fcitx-config-gtk3Optional: Installing Japanese Fonts
sudo apt install fonts-noto-cjk -yFinal Step
Reboot to apply settings:
sudo reboot4. Setting the Timezone and Locale
By default, new Ubuntu installations—especially cloud images—use the UTC timezone. This may cause incorrect timestamps, so adjusting the timezone and locale is important.
Setting the Timezone
1. Check current timezone
timedatectl2. Change to JST (Japan Standard Time)
sudo timedatectl set-timezone Asia/TokyoSetting the Locale
1. Check current locale
locale2. Enable Japanese locale
sudo locale-gen ja_JP.UTF-8Set as default:
sudo update-locale LANG=ja_JP.UTF-83. Apply changes
source /etc/default/locale5. Keyboard Configuration
Ubuntu’s default keyboard settings may not match Japanese keyboards. This section explains how to adjust the layout and remap the CapsLock key.
Checking the Keyboard Layout
localectl statusSwitching to Japanese Keyboard Layout
sudo localectl set-keymap jp
sudo localectl set-x11-keymap jpRemapping CapsLock to Ctrl
Temporary method
setxkbmap -option ctrl:nocapsPermanent method
sudo nano /etc/default/keyboardChange:
XKBOPTIONS="ctrl:nocaps"Apply:
sudo dpkg-reconfigure keyboard-configuration
sudo reboot
6. Configuring the Firewall
Ubuntu includes a built-in firewall called UFW (Uncomplicated Firewall), which makes firewall management simple and effective. Proper configuration of UFW enhances system security by preventing unauthorized access.
This section explains the basic UFW setup and recommended security rules.
Enabling the Firewall
First, check whether UFW is enabled.
1. Check UFW status
sudo ufw statusExample (disabled):
Status: inactiveExample (enabled):
Status: active2. Enable UFW
sudo ufw enableOnce enabled, UFW applies its default rules to manage network traffic.
Basic Firewall Rule Configuration
UFW works by allowing only the traffic you explicitly permit.
1. Set default policies
sudo ufw default deny incoming
sudo ufw default allow outgoing2. Allow SSH (remote connection)
sudo ufw allow 22/tcpIf your server uses a non-standard SSH port (e.g., 2222):
sudo ufw allow 2222/tcp3. Allow HTTP/HTTPS for web servers
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp4. Allow other services (optional)
FTP:
sudo ufw allow 21/tcpMySQL:
sudo ufw allow 3306/tcpPostgreSQL:
sudo ufw allow 5432/tcp5. Apply changes
sudo ufw reloadChecking Rules and Logs
1. View current firewall rules
sudo ufw status numberedExample:
Status: active
To Action From
-- ------ ----
[ 1] 22/tcp ALLOW Anywhere
[ 2] 80/tcp ALLOW Anywhere
[ 3] 443/tcp ALLOW Anywhere
2. Remove unnecessary rules
sudo ufw delete 13. Enable logging (optional)
sudo ufw logging onLogs appear in:
/var/log/ufw.logTemporarily Disable UFW
sudo ufw disableRe-enable:
sudo ufw enableSummary
To configure the firewall effectively:
- Enable UFW
- Set default rules
- Allow necessary ports (SSH, HTTP/HTTPS)
- Reload and verify settings
- Enable logging for security monitoring
7. Configuring the SSH Server
SSH (Secure Shell) allows secure remote access to your Ubuntu system. For servers, enabling SSH and applying security hardening is essential.
This section covers installation and important security settings.
Installing and Starting the SSH Server
1. Install OpenSSH server
sudo apt install openssh-server -y2. Check SSH server status
sudo systemctl status sshYou should see:
Active: active (running)3. Enable auto-start
sudo systemctl enable sshChanging SSH Port (Security Enhancement)
Port 22 is frequently targeted by attackers. Changing it reduces brute-force attempts.
1. Edit the SSH config
sudo nano /etc/ssh/sshd_configFind:
#Port 22Change to:
Port 22222. Restart SSH
sudo systemctl restart ssh3. Allow the new port with UFW
sudo ufw allow 2222/tcpSetting Up Public Key Authentication
This method replaces password-based login with key-based authentication, providing significantly better security.
1. Generate an SSH key pair (client PC)
ssh-keygen -t rsa -b 40962. Copy the public key to the server
ssh-copy-id -p 2222 user@your-server-ipIf ssh-copy-id cannot be used:
cat ~/.ssh/id_rsa.pub | ssh -p 2222 user@your-server-ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"3. Disable password authentication
sudo nano /etc/ssh/sshd_configChange:
PasswordAuthentication noConfirm:
PubkeyAuthentication yesThen restart SSH:
sudo systemctl restart ssh4. Test the connection
ssh -p 2222 user@your-server-ipSummary of SSH Security Hardening
- Change SSH port
- Disable password authentication
- Use key-based authentication
- Limit login attempts (Fail2Ban)
Install Fail2Ban:
sudo apt install fail2ban -y8. Installing Software
Ubuntu includes only minimal software by default. Installing essential and development tools greatly improves usability.
Ways to Install Software
- APT packages
sudo apt install package-name- Snap packages
sudo snap install package-name- Flatpak (optional)
flatpak install package-name- PPA repositories
sudo add-apt-repository ppa:repository-name- Installing .deb files
sudo dpkg -i package-name.debRecommended Basic Software
1. Web Browser (Google Chrome)
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install -f2. Office Suite (LibreOffice)
sudo apt install libreoffice -y3. Media Player (VLC)
sudo apt install vlc -y4. Code Editor (Visual Studio Code)
sudo snap install code --classic5. Command-line Tools (htop, curl, git)
sudo apt install htop curl git -y6. Archive Tools (zip, unzip, rar)
sudo apt install zip unzip rar unrar -y7. Google Drive Integration
sudo apt install gnome-online-accounts -yDeveloper Tools
1. Docker
sudo apt install docker.io -y
sudo systemctl enable --now docker
sudo usermod -aG docker $USER2. Python & pip
sudo apt install python3 python3-pip -y3. Node.js & npm
sudo apt install nodejs npm -y4. MySQL Server
sudo apt install mysql-server -y
sudo systemctl enable --now mysqlChecking Installed Software
dpkg --get-selections | grep -v deinstallSnap packages:
snap listSummary
A recommended software list:
| Software | Description | Install Method |
|---|---|---|
| Google Chrome | Fast web browser | wget + dpkg |
| LibreOffice | Office suite | apt install |
| VLC | Media player | apt install |
| Visual Studio Code | Code editor | snap install |
| Git | Version control | apt install |
| Docker | Container virtualization | apt install |
| MySQL | Database | apt install |
9. Configuring Automatic Updates
Regular security patches and bug fixes are essential for maintaining a safe and stable Ubuntu environment. While you can apply updates manually, enabling automatic updates ensures your system stays up to date with minimal effort.
This section explains how to set up automatic updates using the unattended-upgrades package.
Installing and Configuring unattended-upgrades
1. Install unattended-upgrades
sudo apt install unattended-upgrades -y2. Enable automatic updates
sudo dpkg-reconfigure unattended-upgrades3. Edit the configuration file
sudo nano /etc/apt/apt.conf.d/50unattended-upgradesEnable these lines if they are commented out:
Unattended-Upgrade::Allowed-Origins {
"Ubuntu stable";
"Ubuntu security";
"Ubuntu LTS";
};To remove unused packages automatically, set:
Unattended-Upgrade::Remove-Unused-Dependencies "true";4. Configure update frequency
sudo nano /etc/apt/apt.conf.d/20auto-upgradesEnsure the following:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";5. Test the configuration
sudo unattended-upgrade --dry-runChecking Automatic Update Logs
View logs:
cat /var/log/unattended-upgrades/unattended-upgrades.logMonitor in real time:
tail -f /var/log/unattended-upgrades/unattended-upgrades.logDisabling Automatic Updates (if necessary)
sudo dpkg-reconfigure -plow unattended-upgradesOr manually edit:
APT::Periodic::Unattended-Upgrade "0";Summary
To enable automatic updates:
- Install
unattended-upgrades - Enable the automatic update system
- Configure
/etc/apt/apt.conf.d/20auto-upgrades - Test the configuration
- Check logs regularly
Automatic updates are especially important for applying security patches quickly and maintaining safety.
10. FAQ (Frequently Asked Questions)
During Ubuntu setup, many users encounter similar questions or issues. This section answers common questions related to initial Ubuntu configuration.
Q1: Do I need to reboot after initial configuration?
A1:
Yes. Some settings—such as language configuration, keyboard mappings, timezone changes, and SSH settings—require a reboot to apply.
sudo rebootQ2: Japanese input is not working. What should I do?
A2:
Check the following:
im-config -n fcitxsudo apt install fcitx-mozc -yfcitx-autostartQ3: The Ubuntu timezone is incorrect. How can I fix it?
A3:
timedatectl
sudo timedatectl set-timezone Asia/TokyoQ4: SSH connection fails (or is refused). What should I check?
A4:
sudo systemctl status ssh
sudo systemctl start sshsudo ufw allow 22/tcpsudo nano /etc/ssh/sshd_configsudo systemctl restart sshQ5: Software installation fails with “Unable to locate package”. Why?
A5:
Update repositories:
sudo apt updateEnable additional repositories:
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt updateQ6: How can I check if UFW firewall rules are applied correctly?
A6:
sudo ufw status verbosesudo ufw reloadQ7: The system behaves strangely after updates. What should I do?
A7:
sudo rebootsudo apt autoremove --purgesudo apt install --reinstall package-name=versionsudo dpkg --configure -a
sudo apt install -fQ8: I want to reduce disk usage in Ubuntu. How can I clean up the system?
A8:
sudo apt autoremove -ysudo apt cleanSummary
This article has provided a detailed overview of the essential initial setup steps for Ubuntu. By following these configurations—system updates, Japanese language setup, timezone and locale adjustments, keyboard customization, firewall settings, SSH hardening, installing useful software, and enabling automatic updates—you can build a secure and efficient Ubuntu environment.
The FAQ section also covered common questions and troubleshooting tips to help you resolve typical issues encountered during setup.
Once your Ubuntu system is properly configured, feel free to explore more advanced customization and tailor your environment to your specific needs!



