Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Ubuntu server on raspberry pie

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to install a Ubuntu server on a raspberry pie. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Raspberry pie is the most famous single board computer. Initially, the scope of the raspberry pie project was designed to promote the teaching of basic computer science in schools and developing countries.

Its low cost, portability and extremely low power consumption make it far more popular than expected. From weather stations to home automation, players have built a lot of cool projects with raspberry pie.

The fourth generation of raspberry pie has the functions and processing power of ordinary desktop computers. But this article is not about how to use raspberry pie as a desktop. Instead, I'll show you how to install a Ubuntu server on a raspberry pie.

In this tutorial, I will use raspberry pie 4. Here is what I will introduce:

Install the Ubuntu server on the microSD card

Set up a wireless Internet connection on the raspberry pie

Visit your raspberry pie through SSH

The following equipment is required for this tutorial:

One micro SD card (8GB or larger is recommended)

A computer with a micro SD card reader (running Linux, Windows, or macOS)

Raspberry pie 2, 3 or 4

Good Internet connection

HDMI cable for raspberry pie 2 and 3 and micro HDMI cable for raspberry pie 4 (optional)

One set of USB keyboard (optional)

Install Ubuntu server on raspberry pie

In this tutorial, I use Ubuntu to create a raspberry pie SD card, but you can create it on other Linux distributions, macOS, and Windows. This is because the steps for preparing a SD card are the same for the Raspberry Pi Imager tool.

The Raspberry Pi Imager tool will automatically download the raspberry pie system image of your choice. This means that you need a good network connection to download data around 1GB.

Step 1: prepare the SD card with Raspberry Pi Imager

Make sure you have inserted your microSD card into your computer and installed Raspberry Pi Imager on your computer.

You can download the Imager tool for your operating system from these links:

Raspberry Pi Imager for Ubuntu/Debian

Raspberry Pi Imager for Windows

Raspberry Pi Imager for MacOS

Although I am using Ubuntu, I will not use the Debian package listed above, but will install the snap package using the command line. This approach can be applied to a wider range of Linux distributions.

Sudo snap install rpi-imager

After installing the Raspberry Pi Imager tool, locate and open it and click the "CHOOSE OS" menu.

Scroll the menu and click "Ubuntu" ("Core" and "Server" images).

From the available images, I chose Ubuntu 20.04 LTS 64-bit. If you have a raspberry pie 2, you can only choose a 32-bit mirror.

Important: if you are using the latest raspberry pie 4-8 GB memory model, you should choose a 64-bit operating system, otherwise you can only use 4 GB memory.

Select your microSD card from the "SD Card" menu and click "WRITE".

If it shows some errors, try to write it again. Now it will download the Ubuntu server image and write it to the micro SD card.

When this process is completed, it will inform you.

Step 2: add WiFi support on the Ubuntu server

After burning the micro SD card, you can almost use it. One thing you might want to do before using it is to add Wi-Fi support.

The SD card is still inserted into the card reader. Open the file manager and locate the "system-boot" partition on the card.

The file you are looking for and the file you need to edit is called network-config.

This process can also be done on Windows and MacOS. As mentioned earlier, edit the network-config file and add your Wi-Fi credentials.

First, uncomment the line in the rectangle (remove the label # at the beginning).

After that, replace myhomewifi with your Wi-Fi network name, such as "itsfoss", and replace "S3kr1t" with the Wi-Fi password, enclosed in quotation marks, such as "12345679".

It might look like this:

Wifis: wlan0: dhcp4: true optional: true access-points: "your wifi name": password: "your_wifi_password"

Save the file and insert the micro SD card into your raspberry pie. If your raspberry pie can't connect to the Wi-Fi network the first time you boot, just restart your device.

Step 3: use the Ubuntu server on the raspberry pie (if you have a dedicated monitor, keyboard and mouse)

If you have an extra set of mice, keyboards and monitors, you can easily use raspberry pie like other computers (but without GUI).

Simply insert the micro SD card into the raspberry pie and connect the monitor, keyboard and mouse. Now open your raspberry pie. It will display the TTY login screen (black terminal screen) and ask for the user name and password.

Default user name: ubuntu

Default password: ubuntu

When you see the prompt, use ubuntu as the password. After logging in successfully, Ubuntu will ask you to change your default password.

Enjoy your Ubuntu server!

Step 3: connect remotely to your raspberry pie via SSH (if you don't have a monitor, keyboard and mouse for raspberry pie)

It doesn't matter if you don't have a monitor that works exclusively with raspberry pie. Who needs a server with a monitor when you can access it directly through SSH and use it your way?

On Ubuntu and Mac OS, a SSH client is usually installed. To connect to your raspberry pie remotely, you need to find its IP address. Check the devices connected to your network to see which one is raspberry pie.

Since I don't have a Windows machine, you can visit the comprehensive guide provided by Microsoft.

Open the terminal and run the following command:

Ssh ubuntu@raspberry_pi_ip_address

You may see the following message to confirm the connection:

Are you sure you want to continue connecting (yes/no/ [fingerprint])?

Type yes, and then click enter.

When prompted, use the previously mentioned ubuntu as the password. Of course, you will be asked to change your password.

When you are finished, you will automatically log out and you must reconnect with the new password.

Your Ubuntu server can run on raspberry pie!

Thank you for reading! This is the end of the article on "how to install a Ubuntu server on a raspberry pie". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report