Back to home

Ubuntu Server 20.04

How to manage KVM virtual machines via the command line in Ubuntu 20.04
Jul 28, 2021 7.4k 106 minutes ago

In this post, I showed you how to manage virtual machines with virt-manager. This is great if you have a secondary machine with a graphical user interface running Linux as its operating system. But what do you do if such a machine isn't available, and you'd like to perform simple tasks such as rebooting a virtual machine or checking to see which virtual machines are running on the server? Step 1 : Showing running virtual machines with the virsh list command virsh list Step 2 : We can manage the

How to Create a Virtual Machine in Ubuntu 20.04 with KVM
Jul 28, 2021 7.7k 106 minutes ago

Step 1 : In virt-manager, right-click your server connection and click on New to start the process of creating a new virtual machine Step 2 : The first screen while setting up a new VM Step 3 : The default selection will be on Local install media (ISO image or CDROM); leave this selection and click on Forward: Step 4 : On the next screen, click on Browse to open up another window where you can select an ISO image you've downloaded. If you click on your ISO storage pool, you should see a list

How to Setup bridged networking for KVM in Ubuntu 20.04
Jul 28, 2021 43.3k 106 minutes ago

Bridged networking allows your VMs to receive an IP address from the DHCP server on your network instead of its internal one, which will allow you to communicate with your VMs from any other machine on your network. Step 1 : To set up bridged networking, we'll need to create a new interface on our server. Open up the /etc/netplan/01-network-manager-all.yaml file in your text editor with sudo. cd /etc/netplan/ # make backup sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.orig sudo

How to install KVM on Ubuntu 20.04 LTS
Jul 28, 2021 7.9k 106 minutes ago

Step 1 : you can run the following command on the machine you intend to host KVM virtual machines on in order to find out whether your CPU supports virtualization extensions egrep -c '(vmx|svm)' /proc/cpuinfo A result of 1 or more means that your CPU does support virtualization extensions Step 2 : We'll also need to create a group named kvm as we're going to allow members of this group to manage virtual machines: sudo groupadd kvm Step 3 : Even though KVM is built into the Linux kernel, we'll s

How To Install phpMyAdmin with Apache on an Ubuntu Server 20.04
Jul 28, 2021 7.4k 106 minutes ago

You will need access to a root account or an account with sudo privileges You will need a LAMP stack (Linux, Apache, MySQL, and PHP) Step 1 : Install phpMyAdmin with the following commands sudo apt-get update sudo apt install phpmyadmin php-zip php-json php-mbstring php-mysql php-curl php-gd Step 2 : Next, phpmyadmin will ask for web server selection, choose apache2 Step 3 : The installation process will download the necessary packages and then prompt you to configure phpmyadmin. Choose yes to

How To Import and Export Databases in MySQL using Command Line on Ubuntu Server 20.04
Jul 28, 2021 14.9k 106 minutes ago

You can always use tools such as MySQL workbench and phpMyAdmin, but MySQL provides command-line tools for the bulk processing of data that are more efficient and flexible. Follow these steps to import and export Databases in MySQL. Exporting MySQL database Step 1 : To export a database from the MySQL server, use the following command mysqldump -u admin -p blog > db_blog_backup.sql Step 2 : To export specific tables from a database, use the following command mysqldump -u admin -p blog table1

How to Use MySQL from the Command Line on Ubuntu Server 20.04
Jul 28, 2021 6.7k 106 minutes ago

Step 1 : First, we will need to connect to the MySQL server mysql -u admin -h localhost -p Replace admin with a user account on the MySQL server Step 2 : Enter the password for the admin account Step 3 : Create a database with the following query. mysql> create database blog; Step 4 : Check all databases with a show databases query. mysql> show databases; Step 5 : Select a database to work with mysql> use blog; Step 6 : Create a table to store our data. Use the following query to cr

How to Create MySQL Users Accounts and Grant Privileges in MySQL 8.0 On Ubuntu Server 20.04
Jul 27, 2021 11.8k 106 minutes ago

We will learn how to add new users to the MySQL database server. MySQL provides very flexible and granular user management options. Follow these steps to add users to MySQL database server and assign access rights: Step 1 : Open the MySQL shell with the following command. sudo mysql Step 2 : From the MySQL shell, use the following command to add a new user to MySQL: mysql> create user 'admin'@'localhost' identified by 'password'; Step 3 : You can check the user account with the foll

How To Install MySQL 8.0 on Ubuntu Server 20.04
Jul 27, 2021 8.4k 106 minutes ago

We will learn how to install and configure the MySQL database on an Ubuntu server. Follow these steps to install the MySQL 8.0 Step 1 : MySQL 8.0 is included in the default Ubuntu repository for 20.04. You can list each of the available MySQL 8.0 packages with the following command: apt-cache pkgnames | grep mysql-server step 1 : To install the MySQL server, use the following command: sudo apt-get update sudo apt-get install mysql-server-8.0 Step 2 : Once the installation process is c

How to Change Hostname on Ubuntu 20.04
Jul 24, 2021 7.2k 106 minutes ago

How do you view your hostname? Step 1 : You need to use the hostname command or hostnamectl command hostname Step 2 : Output from the hostname command Setting the hostname Step 1 :Changing the hostname is fairly simple. To do this, we can use the hostnamectl command as root or with sudo. sudo hostnamectl set-hostname devtutorial.io Step 2 : Open the /etc/hosts file and change the old hostname to the new one. sudo nano /etc/hosts Step 3 : Verify the change hostname

How to Setup DHCP Server in Ubuntu Server 20.04
Jul 24, 2021 15.3k 106 minutes ago

DHCP is a service used to automatically assign network configuration to client systems. DHCP can be used as a handy tool when you have a large pool of systems that needs to be configured for network settings. Plus, when you need to change the network configuration, say to update a DNS server, all you need to do is update the DHCP server and all the connected hosts will be reconfigured with new settings. Also, you get reliable IP address configuration that minimizes configuration errors and addre

How to set a static ip address in Ubuntu Server 20.04
Jul 24, 2021 35.0k 106 minutes ago

When you install Ubuntu server, its network setting defaults to dynamic IP addressing, that is, the network management daemon in Ubuntu searches for a DHCP server on the connected network and configures the network with the IP address assigned by DHCP. Even when you start an instance in the cloud, the network is configured with dynamic addressing using the DHCP server setup by the cloud service provider. In this chapter, you will learn how to configure the network interface with static IP assign

How To Install PHP for Apache on Ubuntu Server 20.04
Jul 23, 2021 6.7k 106 minutes ago

Follow these steps to serve dynamic contents with PHP Step 1 : Add PHP PPA Repository sudo apt -y install software-properties-common sudo add-apt-repository ppa:ondrej/php Step 2 : Update the apt package repository and install PHP 7.4 sudo apt update sudo apt install php7.4 Step 3 : Check if PHP is properly installed and which version has been installed: php -v Step 4 : Run command to install additional packages: sudo apt install php7.4-{mysql,curl,json,cgi,xsl,gd,common,xml,zip,soap,bcmath}

How to Install and Configure the Apache web server on Ubuntu Server 20.04
Jul 23, 2021 7.7k 106 minutes ago

Installing Apache2 Follow these steps to install and configure the Apache web server: Step 1 : Install Apache2 from the Ubuntu package repository: sudo apt-get update sudo apt-get install apache2 Step 2 : Check if Apache2 is properly installed and running sudo service apache2 status Step 3 : You can also open a browser on a local machine and point it to the server IP address. You should see a default It works! Configuring Apache2 Step 4 : Now, let's proceed with creating o

How to Install SSL Certificate for Apache on Ubuntu Server 20.04
Jul 21, 2021 12.0k 106 minutes ago

Follow these steps to set HTTPs on Apache Generating SSL Certificates Step 1 : Create a directory to hold all certificate and keys sudo mkdir -p /etc/apache2/ssl/example.com Step 2 : Change to the new directory and enter the following command to create a certificate and SSL key cd /etc/apache2/ssl/example.com sudo openssl req -newkey rsa:2048 -x509 -nodes -days 365 -keyout example.com.key -out example.com.crt Step 3 : This will prompt you to enter some information about your company and websit