- 1 1. Introduction
- 2 2. System Updates
- 3 3. Configuring the Japanese Environment
- 4 4. Configuring Time Zone and Locale
- 5 5. Configuring the Keyboard
- 6 6. Configuring the Firewall
- 7 7. Configuring the SSH Server
- 8 8. Installing Essential Software
- 9 9. Configuring Automatic Updates
- 10 10. FAQ (Frequently Asked Questions)
- 10.1 Q1: Do I need to restart my system after completing the initial setup?
- 10.2 Q2: Japanese input is not working properly. How can I fix it?
- 10.3 Q3: My system is displaying the wrong time zone. How do I fix it?
- 10.4 Q4: I can’t connect to my Ubuntu system via SSH (connection refused or denied).
- 10.5 Q5: I can’t install software (error: “E: Unable to locate package”).
- 10.6 Q6: How do I check if the firewall (UFW) settings are applied correctly?
- 10.7 Q7: My system became unstable after an update. How do I fix it?
- 10.8 Q8: How can I free up disk space in Ubuntu?
- 11 Conclusion
1. Introduction
Ubuntu is one of the most widely used Linux distributions, catering to both beginners and advanced users. Its open-source nature and strong community support make it an attractive choice. However, a fresh installation of Ubuntu does not immediately offer an optimal experience. Some basic initial settings must be configured to ensure smooth and efficient usage.
This guide will walk you through the essential setup steps after installing Ubuntu. Each step is explained in detail, including how to run commands and the purpose of each setting, ensuring even beginners can follow along with ease.
Why You Need to Configure Ubuntu After Installation
A fresh Ubuntu installation may lack certain functionalities in terms of usability and security. Some common issues include:
- System Updates Required: The packages included in the installation media may not be the latest versions. Updating is essential for security patches and bug fixes.
- Incomplete Language Support: Ubuntu is set to English by default. Additional configurations are necessary for seamless Japanese input and display.
- Unconfigured Security Settings: Without enabling the firewall or properly setting up SSH, your system may be vulnerable to unauthorized access.
- Missing Essential Software: The default installation includes only minimal applications. You may need to install additional software for daily use.
Who This Guide Is For
This guide is intended for the following users:
- Beginners who have just installed Ubuntu
- Users unfamiliar with basic Linux command-line configuration
- Anyone looking to enhance Ubuntu’s usability and security
Each section provides step-by-step instructions, allowing you to smoothly configure your system. Follow along, and you’ll be ready to use Ubuntu efficiently.
In the next section, we will explain how to update Ubuntu’s software packages to the latest version.
2. System Updates
Right after installing Ubuntu, the software packages included in the system may not be up to date. To ensure security and system stability, the first step should be updating your system to the latest version.
Why System Updates Are Necessary
The Ubuntu installation media contains packages that were current at the time of release. However, since then, security patches and bug fixes may have been released. Not updating your system could result in the following risks:
- Security Vulnerabilities: Older packages may contain security flaws that attackers can exploit.
- Unresolved Bugs: Software issues that have already been fixed by developers may still exist in your system.
- Compatibility Issues: New applications may not work properly due to outdated system libraries or dependencies.
To avoid these risks, it’s highly recommended to update the package list and upgrade all software immediately after installing Ubuntu.
Updating the Package List
Ubuntu uses APT (Advanced Package Tool) to manage software packages. First, update the package list by running the following command:
sudo apt updateThis command fetches the latest package information from Ubuntu’s repositories and updates the system’s internal database.
Upgrading Installed Packages
Once the package list is updated, upgrade all installed packages with the following command:
sudo apt upgrade -yThis will download and install newer versions of existing packages. The -y option allows the upgrade process to proceed without confirmation.
Removing Unnecessary Packages (Recommended)
After upgrading, it’s a good idea to remove outdated and unused packages to free up disk space. Run the following command:
sudo apt autoremove -yThis command automatically removes unused libraries and dependencies that are no longer needed.
Restarting the System (If Necessary)
If a kernel update or critical system package upgrade is included, a system reboot may be required. To check if a reboot is needed, run the following command:
sudo rebootIf a kernel update was applied, restarting is necessary to apply the changes.
3. Configuring the Japanese Environment
By default, Ubuntu is set to English as the primary language. To use Japanese comfortably, you need to install language packs and set up a Japanese input system.
This section provides a detailed guide on how to configure the Japanese environment in Ubuntu.
Installing the Japanese Language Pack
First, install the Japanese language pack to enable Japanese menus and system settings.
1. Installing the Japanese Language Pack
Open the terminal and run the following command:
sudo apt install language-pack-ja -yThis command installs the Japanese locale data required for system-wide Japanese language support.
2. Changing the System Language to Japanese
Next, set the system language to Japanese by running:
LANG=ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8To apply the changes, log out and log back in, or restart the system:
sudo rebootAfter rebooting, check if menus and dialogs are displayed in Japanese.
Setting Up Japanese Input (Installing Mozc)
By default, Japanese input is not enabled in Ubuntu. To type in Japanese, you need to install an Input Method Editor (IME).
Recommended IME:
- Mozc (The open-source version of Google Japanese Input)
1. Installing Mozc
Run the following command to install Mozc, a popular Japanese input method:
sudo apt install fcitx-mozc -y2. Switching the Input Method to Fcitx
To use Mozc, you need to change the input method to Fcitx. Run the following command:
im-config -n fcitxThen, restart the system to apply the changes:
sudo reboot3. Configuring Fcitx
After rebooting, open “Settings” → “Language Support” → “Keyboard Input Method” and ensure “Fcitx” is selected.
Next, open the Fcitx settings tool and enable Mozc:
fcitx-config-gtk3If “Mozc” is not listed in the “Input Method” section, click the “+” button and add it manually.
Once configured, open a text editor and press the “Half-width/Full-width” key to check if Japanese input is working correctly.
Installing Japanese Fonts (Optional)
Ubuntu includes basic Japanese fonts, but you can install additional fonts for better readability.
To install Japanese fonts like Noto CJK, run:
sudo apt install fonts-noto-cjk -yFinal Steps to Apply the Settings
After completing the Japanese environment setup, restart the system to ensure all changes take effect:
sudo rebootAfter rebooting, confirm that Japanese characters display correctly and that Japanese input works smoothly.
4. Configuring Time Zone and Locale
After installing Ubuntu, the default time zone and locale (regional and language settings) may not be correctly set. This is especially common when setting up Ubuntu in a global server or cloud environment, where the default time zone is often set to UTC (Coordinated Universal Time). If not properly configured, you may experience incorrect timestamps in logs or other applications.
This section explains how to correctly set the time zone and locale for your Ubuntu system.
Setting the Time Zone
In Ubuntu, you can use the timedatectl command to configure the time zone.
1. Checking the Current Time Zone
Run the following command to check your current time zone settings:
timedatectlExample output:
Local time: Thu 2025-03-05 12:34:56 UTC
Universal time: Thu 2025-03-05 12:34:56 UTC
RTC time: Thu 2025-03-05 12:34:56
Time zone: Etc/UTC (UTC, +0000)In this example, the system is set to UTC, so we need to change it to Japan Standard Time (JST).
2. Changing the Time Zone to Japan Standard Time (JST)
Run the following command to change the time zone to Asia/Tokyo:
sudo timedatectl set-timezone Asia/Tokyo3. Verifying the New Time Zone
Run the following command again to check if the time zone has been updated:
timedatectlExample output:
Local time: Thu 2025-03-05 21:34:56 JST
Universal time: Thu 2025-03-05 12:34:56 UTC
RTC time: Thu 2025-03-05 12:34:56
Time zone: Asia/Tokyo (JST, +0900)If Asia/Tokyo (JST, +0900) appears in the output, the setting has been applied correctly.
Setting the System Locale
The locale settings define the system’s language and regional preferences. By default, Ubuntu may be set to English (en_US.UTF-8), so we will change it to Japanese (ja_JP.UTF-8).
1. Checking the Current Locale
Run the following command to check your current locale settings:
localeExample output (default English settings):
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
...2. Enabling the Japanese Locale
Check if the Japanese locale is installed and add it if necessary:
sudo locale-gen ja_JP.UTF-8Then, set the default locale to ja_JP.UTF-8:
sudo update-locale LANG=ja_JP.UTF-83. Applying the Changes
To apply the new locale settings, either restart your system or run the following command:
source /etc/default/localeThen, check if the changes have been applied:
localeExample output:
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
...Final Verification
To ensure that the time zone and locale settings are correctly applied, check the following:
- Run
timedatectlto confirm the time zone is set toAsia/Tokyo. - Run
localeto confirm the locale is set toja_JP.UTF-8. - Verify that system menus, timestamps, and language settings reflect the changes.
If the changes do not take effect, try logging out and logging back in, or restarting the system.
5. Configuring the Keyboard
Ubuntu’s default keyboard settings may not be optimized for Japanese users. If you are using a Japanese keyboard, some keys may not function correctly. Additionally, modifying the keyboard layout can improve usability, such as swapping the Caps Lock key with the Ctrl key.
This section explains how to configure your keyboard layout and customize key mappings in Ubuntu.
Setting the Keyboard Layout
1. Checking the Current Keyboard Layout
Run the following command to check your current keyboard layout settings:
localectl statusExample output:
System Locale: LANG=ja_JP.UTF-8
VC Keymap: us
X11 Layout: usIn this example, the keyboard layout is set to us (English), so it needs to be changed if you are using a Japanese keyboard.
2. Changing the Keyboard Layout to Japanese
If you are using a Japanese keyboard (JP layout), update the settings with the following command:
sudo localectl set-keymap jp
sudo localectl set-x11-keymap jpTo apply the changes, log out and log back in or restart your system.
Changing the Caps Lock Key to Ctrl
Many developers and power users prefer to use the Caps Lock key as an additional Ctrl key for improved efficiency. Ubuntu allows you to remap the Caps Lock key to Ctrl.
1. Temporarily Changing the Caps Lock Key
To change the Caps Lock key to Ctrl temporarily, run the following command:
setxkbmap -option ctrl:nocapsThis setting will reset after a reboot. To make it permanent, follow the next steps.
2. Permanently Changing the Caps Lock Key
To set Caps Lock as Ctrl permanently, edit the keyboard configuration file:
sudo nano /etc/default/keyboardFind the following line:
XKBOPTIONS=""Change it to:
XKBOPTIONS="ctrl:nocaps"Save the file and apply the changes with:
sudo dpkg-reconfigure keyboard-configurationThen, restart your system to activate the new keyboard settings:
sudo rebootAdditional Keyboard Customization (Optional)
Ubuntu allows further customization of key mappings. Here are some additional options:
- Swap Ctrl and Caps Lock
setxkbmap -option ctrl:swapcaps- Assign Esc to the Caps Lock Key (Useful for Vim Users)
setxkbmap -option caps:escapeTo make these settings permanent, add them to the XKBOPTIONS field in /etc/default/keyboard as shown earlier.
Verifying the Configuration
After configuring your keyboard, check if the settings have been applied correctly:
- Run
localectl statusto confirm the keyboard layout is set tojp. - Press the Caps Lock key to verify if it functions as a Ctrl key (if changed).
- If the settings are not applied, restart your system and check again.
With these configurations, your keyboard should now be properly set up for an improved Ubuntu experience.
6. Configuring the Firewall
Ubuntu comes with a built-in firewall called UFW (Uncomplicated Firewall), which makes it easy to manage firewall settings. By properly configuring UFW, you can block unauthorized access and enhance your system’s security.
This section explains how to enable UFW and set up basic firewall rules.
Enabling the Firewall
UFW is installed by default on Ubuntu, but it may not be enabled. First, check the current status of UFW.
1. Checking the Firewall Status
sudo ufw statusExample output if UFW is disabled:
Status: inactiveExample output if UFW is enabled:
Status: active2. Enabling UFW
If UFW is inactive, enable it with the following command:
sudo ufw enableOnce enabled, UFW will start blocking unauthorized connections according to its default rules.
Setting Basic Firewall Rules
UFW allows you to specify which connections should be allowed or blocked. Below are the recommended settings for most users.
1. Setting Default Policies
By default, block incoming connections and allow outgoing connections with:
sudo ufw default deny incoming
sudo ufw default allow outgoing2. Allowing SSH (Remote Access)
If you use SSH to connect to your system remotely, you need to allow SSH connections. Run the following command:
sudo ufw allow 22/tcpIf you have changed the SSH port (e.g., to port 2222), allow that port instead:
sudo ufw allow 2222/tcp3. Allowing Web Server Traffic (HTTP/HTTPS)
If your system runs a web server (such as Apache or Nginx), allow HTTP and HTTPS traffic:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp4. Allowing Other Services (If Needed)
If you use additional services, open their respective ports:
- FTP (Port 21)
sudo ufw allow 21/tcp- MySQL (Port 3306)
sudo ufw allow 3306/tcp- PostgreSQL (Port 5432)
sudo ufw allow 5432/tcp5. Applying the Rules
After setting the rules, reload UFW to apply the changes:
sudo ufw reloadVerifying Firewall Settings
1. Checking Allowed Rules
To view the currently allowed firewall rules, run:
sudo ufw status numberedExample output:
Status: active
To Action From
-- ------ ----
[ 1] 22/tcp ALLOW Anywhere
[ 2] 80/tcp ALLOW Anywhere
[ 3] 443/tcp ALLOW Anywhere2. Removing a Firewall Rule
If you need to remove a rule, check the rule number using the previous command and delete it using:
sudo ufw delete 13. Enabling Firewall Logging (Optional)
To monitor firewall activity, enable logging with:
sudo ufw logging onFirewall logs can be found in /var/log/ufw.log.
Temporarily Disabling the Firewall
If you need to temporarily disable UFW, use the following command:
sudo ufw disableTo re-enable it, run:
sudo ufw enableSummary
UFW is a simple yet powerful firewall that provides essential security for Ubuntu systems. At a minimum, follow these steps:
- Enable UFW (
sudo ufw enable) - Set default policies (
sudo ufw default deny incomingandsudo ufw default allow outgoing) - Allow necessary ports (SSH, HTTP, HTTPS, etc.)
- Apply the rules (
sudo ufw reload) and verify settings (sudo ufw status numbered) - Enable firewall logging for security monitoring (
sudo ufw logging on)
By following these steps, you can protect your Ubuntu system from unauthorized access while ensuring that essential services remain available.
7. Configuring the SSH Server
SSH (Secure Shell) is a protocol that allows you to connect to Ubuntu remotely and manage it securely. If you are using Ubuntu as a server, SSH is essential for remote administration. However, the default SSH settings may not be secure enough, so it is important to apply security enhancements.
This section explains how to install and configure an SSH server in Ubuntu while improving security.
Installing and Starting the SSH Server
The SSH server is not installed by default on Ubuntu Desktop, so you need to install it manually.
1. Installing the SSH Server (OpenSSH)
sudo apt install openssh-server -y2. Checking SSH Server Status
To check if the SSH server is running, use the following command:
sudo systemctl status sshExample output:
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since ...If you see Active: active (running), SSH is running properly.
3. Enabling SSH to Start on Boot
sudo systemctl enable sshChanging the SSH Port (Security Enhancement)
The default SSH port (22) is commonly targeted by brute-force attacks. Changing the port number can help reduce attack attempts.
1. Editing the SSH Configuration File
sudo nano /etc/ssh/sshd_configFind the following line and remove the # to uncomment it, then change the port number:
#Port 22For example, to change the port to 2222, modify the line as follows:
Port 22222. Restarting the SSH Server to Apply Changes
sudo systemctl restart ssh3. Allowing the New SSH Port in the Firewall
sudo ufw allow 2222/tcpThen, verify that SSH is listening on the new port:
sudo netstat -tulnp | grep sshSetting Up Public Key Authentication (Disabling Password Login)
For enhanced security, it is recommended to disable password authentication and use public key authentication instead.
1. Generating SSH Key Pairs (On the Client Machine)
On your local machine (client), generate an SSH key pair:
ssh-keygen -t rsa -b 4096This creates a private key (~/.ssh/id_rsa) and a public key (~/.ssh/id_rsa.pub).
2. Copying the Public Key to the Ubuntu Server
ssh-copy-id -p 2222 user@your-server-ipIf ssh-copy-id is not available, you can manually copy the key:
cat ~/.ssh/id_rsa.pub | ssh -p 2222 user@your-server-ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"3. Disabling Password Authentication
Edit the SSH configuration file:
sudo nano /etc/ssh/sshd_configFind the following line:
#PasswordAuthentication yesModify it as follows:
PasswordAuthentication noAlso, ensure that public key authentication is enabled:
PubkeyAuthentication yes4. Restarting SSH to Apply Changes
sudo systemctl restart ssh5. Testing SSH Login
Try logging in with the new port and key authentication:
ssh -p 2222 user@your-server-ipIf successful, you no longer need to enter a password for SSH login.
Additional SSH Security Measures
- Change the SSH port (avoid using the default port 22).
- Use public key authentication (disable password authentication).
- Allow SSH access only to specific IP addresses (if applicable).
- Limit login attempts to prevent brute-force attacks.
1. Installing fail2ban to Prevent Brute-Force Attacks
sudo apt install fail2ban -y2. Restricting SSH to Specific Users (Optional)
Edit /etc/ssh/sshd_config and add:
AllowUsers your_username3. Restarting SSH to Apply Changes
sudo systemctl restart sshSummary
By applying these SSH security enhancements, you can significantly reduce the risk of unauthorized access.
- Install and enable the SSH server.
- Change the default SSH port.
- Enable public key authentication and disable password authentication.
- Limit login attempts using
fail2ban. - Use the firewall to restrict SSH access to specific ports.
These steps will help ensure a secure and reliable remote management environment for your Ubuntu system.
8. Installing Essential Software
After installing Ubuntu, only a minimal set of applications is included. To create a more convenient and efficient work environment, you may need to install additional software.
This section introduces recommended software for Ubuntu and explains how to install them.
Methods for Installing Software
Ubuntu offers several ways to install software:
- Using APT (Advanced Package Tool)
sudo apt install package-name- Using Snap Packages
sudo snap install package-name- Using Flatpak (Optional)
flatpak install package-name- Using PPA (Personal Package Archive)
sudo add-apt-repository ppa:repository-name
sudo apt update- Manually Installing
.debPackages
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. Compression and Extraction Tools (zip, unzip, rar)
sudo apt install zip unzip rar unrar -y7. Cloud Storage (Google Drive Integration)
sudo apt install gnome-online-accounts -yRecommended Software for Developers
1. Docker (Container Management)
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 (Database Management)
sudo apt install mysql-server -y
sudo systemctl enable --now mysqlChecking Installed Software
To list installed packages:
dpkg --get-selections | grep -v deinstallTo check installed Snap packages:
snap listSummary
To enhance the usability of Ubuntu, consider installing the following software:
| Software | Description | Installation Method |
|---|---|---|
| Google Chrome | Fast web browser | wget + dpkg |
| LibreOffice | Free office suite | apt install |
| VLC | Multimedia player | apt install |
| Visual Studio Code | Code editor | snap install code --classic |
| Git | Version control system | apt install |
| Docker | Container virtualization | apt install |
| MySQL | Database management system | apt install |
Installing these applications will improve the functionality and usability of your Ubuntu system, making it more efficient for daily tasks and development.
9. Configuring Automatic Updates
Keeping Ubuntu updated is crucial for security and stability. While manual updates can be performed, automating the update process ensures your system stays up-to-date without requiring user intervention.
This section explains how to configure automatic updates in Ubuntu.
Installing and Configuring unattended-upgrades
Ubuntu includes a package called unattended-upgrades, which allows the system to automatically apply security and other important updates.
1. Installing unattended-upgrades
sudo apt install unattended-upgrades -y2. Enabling Automatic Updates
sudo dpkg-reconfigure unattended-upgrades3. Editing the Configuration File
To customize automatic updates, edit the configuration file:
sudo nano /etc/apt/apt.conf.d/50unattended-upgradesEnsure the following lines are present (or uncommented):
Unattended-Upgrade::Allowed-Origins {
"Ubuntu stable";
"Ubuntu security";
"Ubuntu LTS";
};To automatically remove unused packages, enable the following setting:
Unattended-Upgrade::Remove-Unused-Dependencies "true";4. Configuring Update Frequency
sudo nano /etc/apt/apt.conf.d/20auto-upgradesEnsure the following lines are set:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";5. Testing Automatic Updates
sudo unattended-upgrade --dry-runChecking Automatic Update Logs
To verify if automatic updates are working, check the logs:
cat /var/log/unattended-upgrades/unattended-upgrades.logFor real-time monitoring:
tail -f /var/log/unattended-upgrades/unattended-upgrades.logDisabling Automatic Updates (If Needed)
If you want to disable automatic updates, run:
sudo dpkg-reconfigure -plow unattended-upgradesAlternatively, edit /etc/apt/apt.conf.d/20auto-upgrades and set:
APT::Periodic::Unattended-Upgrade "0";Summary
Enabling automatic updates ensures that security patches and bug fixes are applied promptly, keeping your system secure.
- Install
unattended-upgradespackage. - Enable automatic updates.
- Edit
/etc/apt/apt.conf.d/20auto-upgradesto configure update frequency. - Test the setup and check logs to confirm updates are applied.
- Monitor update logs regularly for any issues.
Since security updates are critical for system protection, enabling automatic updates is highly recommended.
10. FAQ (Frequently Asked Questions)
During the initial setup of Ubuntu, many users encounter common questions or issues. This section provides answers to frequently asked questions about Ubuntu’s setup and configuration.
Q1: Do I need to restart my system after completing the initial setup?
A1:
Yes, certain settings (such as language configuration, keyboard settings, time zone adjustments, and SSH configuration) require a reboot to take effect.
sudo rebootQ2: Japanese input is not working properly. How can I fix it?
A2:
Check the following settings:
im-config -n fcitxsudo apt install fcitx-mozc -yfcitx-autostartQ3: My system is displaying the wrong time zone. How do I fix it?
A3:
timedatectl
sudo timedatectl set-timezone Asia/TokyoQ4: I can’t connect to my Ubuntu system via SSH (connection refused or denied).
A4:
sudo systemctl status ssh
sudo systemctl start sshsudo ufw allow 22/tcpsudo nano /etc/ssh/sshd_configsudo systemctl restart sshQ5: I can’t install software (error: “E: Unable to locate package”).
A5:
sudo apt updatesudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt updateQ6: How do I check if the firewall (UFW) settings are applied correctly?
A6:
sudo ufw status verbosesudo ufw reloadQ7: My system became unstable after an update. How do I fix it?
A7:
sudo rebootsudo apt autoremove --purgesudo apt install --reinstall package-name=version-numbersudo dpkg --configure -a
sudo apt install -fQ8: How can I free up disk space in Ubuntu?
A8:
sudo apt autoremove -ysudo apt cleanConclusion
This guide has covered the essential initial settings for Ubuntu in detail. The FAQ section has also provided answers to common issues that users may encounter. By following these steps, you can optimize Ubuntu for better performance, security, and usability.
Once you have completed the initial setup, explore Ubuntu further and customize it to suit your needs!


