Cloudflare Tunnels is a service offered by Cloudflare that allows you to securely expose web services running on your local machine or private network to the internet without needing to open ports, set up firewalls, or use a public IP address.
It creates a secure, encrypted tunnel between your origin server and Cloudflare’s network, enabling access to your applications from anywhere.
In this tutorial we will show you how to configure Cloudflare Tunnel on Ubuntu 24.04.
Step 1: Install and Configure Cloudflared
To create and manage tunnels, you will need to install and authenticate cloudflared on your server.
You can install cloudflared with the following command:
After installing cloudflared, you need to authenticate it with your Cloudflare account:
# cloudflared tunnel login
You will get the following message:
Please open the following URL and log in with your Cloudflare account:
https://dash.cloudflare.com/argotunnel?aud=&callback=https%3A%2F%2Flogin.cloudflareaccess.org%2F94jJEwKkBV3dOOKv5oPBEj-B9lWITbj_Gk_9sVN1wnw%3D
Leave cloudflared running to download the cert automatically.
Copy the URL and log in to your Cloudflare account. Once you logged in you will get the following message:
Click on the Authorize button to authorize the tunnel. Cloudflare will download a certificate file to authenticate cloudflared with Cloudflare’s network.
You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
/root/.cloudflared/cert.pem
Once authorization is completed successfully, your cert.pem will be download to the default directory.
Step 2: Create a Cloudflare Tunnel
Now, you are ready to create a Cloudflare Tunnel that will connect cloudflared to Cloudflare’s edge. Running the following command will create a Tunnel:
# cloudflared tunnel create yourtunnel
Note: Replace yourtunnel with a name of your choice.
Next, you need to configure the tunnel to point to your local web server. The configuration file contains keys and values, which is written in YAML syntax.
# nano /root/.cloudflared/config.yml
You have to include the correct tunnel ID and credentials file gotten from the tunnel creation command.
Next, you have to configure your DNS settings on your Cloudflare account by adding a CNAME record.
Also, you can use this command will generate a CNAME record that points to the subdomain of a specific Tunnel.
# tunnel route dns b8294c45-9cd1-40fe-b8f1-519da5d8dfd9 test.yourdomain.com
Step 3: Start and Manage the Cloudflare Tunnel
By default, the tunnel expects to find the configuration file in the default directory, /root/.cloudflared/config.yml but to run tunnel as a service, you might need to move the config.yml file to the /etc/cloudflared/ directory.
PHP (Hypertext Preprocessor) is a widely-used, open-source, server-side scripting language designed for web development. It is especially suited for creating dynamic web pages and applications.
In this tutorial, we will show you how to install PHP 8.4 on a Ubuntu 24.04 OS.
Update Operating System
Update your Ubuntu 22.04 operating system to make sure all existing packages are up to date:
# apt update && apt upgrade
Add PHP Repository
By default, PHP 8.4 is not included in the Ubuntu 24.04 default repository. So you will need to add Ondrej Sury PPA into your system.
First, install the required packages using the following command:
Odoo 18 is an open-source suite of business applications that provides a complete ERP (Enterprise Resource Planning) solution for organizations of various sizes. It offers a wide range of integrated tools and modules to help manage all aspects of a business, such as finance, sales, inventory, human resources, and more.
The open-source community edition is free, making it accessible to small businesses and developers. The enterprise edition, on the other hand, offers additional features, services, and support.
Odoo is highly customizable. Businesses can tailor modules to meet their specific needs, create custom workflows, or build entirely new apps using Odoo’s development framework.
In summary, Odoo is a versatile business management software that can streamline operations and provide real-time insights, making it an ideal solution for companies looking to optimize their business processes.
In this tutorial, we will show you how to install Odoo 18 on a Ubuntu 24.04 OS.
Step 1: Update Operating System
Update your Ubuntu 24.04 operating system to make sure all existing packages are up to date:
# apt update && apt upgrade
Then install all the required packages for the Odoo 18 setup on the Ubuntu 24.04 OS.
Git is a distributed version control system (VCS) used for tracking changes in source code during software development. It allows multiple developers to work on a project simultaneously, making it easier to collaborate, manage, and track changes.
It is widely used in software development, from small personal projects to large-scale enterprise applications. Git is the backbone of many collaborative development workflows, enabling teams to work together efficiently and effectively.
In this tutorial, we will show you how to install Git on a Ubuntu 24.04 OS.
Method 1: Install Git with default package manager APT
Installing Git with a package manager like apt offers you ease of installation; it also allows you easily manage and update Git. However, the version in the default repository is often not the latest release.
The version of Git you get with this method may not be the latest version. This is because Ubuntu prioritizes stability and thorough testing over cutting-edge updates to ensure that software in the official repositories is reliable and secure for users.
Ubuntu 24.04 should have git installed by default. Run the following command to check if you have git installed:
# git --version
If Git is already installed, the version should be displayed:
git version 2.43.0
In order to have the latest LTS version, you will need to add a PPA repository using the following command:
# add-apt-repository ppa:git-core/ppa
Once you are done, update the repository with the following command:
# apt update & apt upgrade
Then install Git:
# apt install git
Verify the installation and display the Git version:
git --version
Output:
git version 2.46.0
Method 2: Install Git from source code
If you want to install a different version of Git you can use the following method to install Git.
First, you need to install some packages that are required for the successful installation and functioning of Git.
Drupal is an open-source content management system (CMS) used for building and managing websites and web applications. It is highly flexible and customizable, making it suitable for a wide range of web projects, from simple blogs to complex enterprise websites.
It is used by a wide range of organizations, including educational institutions, non-profits, businesses, and government agencies, to build websites that require robust content management, high security, and flexibility.
In this tutorial, we will show you how to install Drupal on your Ubuntu 24.04 OS.
Step 1: Update Operating System
Update your Ubuntu24.04 operating system to make sure all existing packages are up to date:
# apt update && apt upgrade -y
Step 2: Install Nginx webserver
You can install Nginx via apt package manager by executing the following command.
# apt install nginx
You can start the Nginx service and configure it to run on startup by entering the following commands:
# systemctl start nginx
# systemctl enable nginx
Verify the status of the Nginx service using systemctl status command:
# systemctl status nginx
Output:
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: active (running)
Docs: man:nginx(8)
Main PID: 10412 (nginx)
Tasks: 2 (limit: 2218)
Memory: 1.7M (peak: 1.9M)
CPU: 23ms
CGroup: /system.slice/nginx.service
├─10412 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
└─10413 "nginx: worker process"
Step 3: Install PHP and PHP extensions for Drupal
By default, Ubuntu 24.04 comes with PHP version 8.3. You can install PHP and other supporting packages using the following command:
Output:
PHP 8.3.6 (cli) (built: Jun 13 2024 15:23:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies
Step 4: Install MySQL and create a database
You can install the MySQL server with the following command:
# apt install mysql-server
Start the database server daemon, and also enable it to start automatically at the next boot with the following commands:
# systemctl start mysql
# systemctl enable mysql
Verify the status of the MySQL service using systemctl status command:
# systemctl status mysql
Output:
● mysql.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
Active: active (running)
Process: 24565 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 24574 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 2218)
Memory: 362.8M (peak: 379.1M)
CPU: 1.160s
CGroup: /system.slice/mysql.service
└─24574 /usr/sbin/mysqld
By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script.
# mysql_secure_installation
Configure it like this:
- Set root password? [Y/n] Y
- Remove anonymous users? [Y/n] Y
- Disallow root login remotely? [Y/n] Y
- Remove test database and access to it? [Y/n] Y
- Reload privilege tables now? [Y/n] Y
Now run the command below to log in to the MySQL shell.
# mysql -u root -p
Once you are logged in to your database server you need to create a database for the Drupal installation:
mysql> CREATE DATABASE drupaldb;
mysql> CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'Str0ngP@ss';
mysql> GRANT ALL PRIVILEGES ON drupaldb. * TO 'drupaluser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit;
Step 5: Download Drupal
The latest version of Drupal is available to download from their website. You can download it with the following command:
Magento is an open-source e-commerce platform that provides online merchants with a flexible shopping cart system, as well as control over the look, content, and functionality of their online stores. It also has a large community of developers and users who contribute to its ongoing development and provide support through forums, documentation, and other resources.
Magento comes in two main editions: Magento Open Source (formerly known as Magento Community Edition) and Magento Commerce (formerly known as Magento Enterprise Edition). The Open Source edition is free to use and provides basic e-commerce functionality, while the Commerce edition is a paid version that includes more advanced features such as customer segmentation, targeted promotions, and advanced marketing tools.
In this tutorial we will show you how to install the Open Source version of Magento 2.4.7 on Ubuntu 24.04 OS.
Before starting the installation, you can check the system requirement for installing Magento 2.4.7.
Step 1: Update Operating System
Update your Ubuntu 24.04 operating system to make sure all existing packages are up to date:
# apt update && apt upgrade
Step 2: Install Apache web server
To install Apache web server, run the following command:
# apt install apache2
You can start the Apache service and configure it to run on startup by entering the following commands:
Magento 2.4.7 comes with support for the latest PHP 8.3, while PHP 8.2 remains fully supported. By default, PHP 8.3 is included in the Ubuntu 24.04 default repository.
You can install PHP 8.3 and required PHP extensions using the following command:
After that, you should restart the Apache web server for the configuration to take effect:
# systemctl restart apache2
Step 4: Install MySQL and create a database
You can install the MySQL server with the following command:
# apt install mysql-server
Verify the status of the MySQL service using systemctl status command:
# systemctl status mysql
Output:
● mysql.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
Active: active (running)
Process: 2907 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 2919 (mysqld)
Status: "Server is operational"
Tasks: 37 (limit: 2130)
Memory: 362.8M (peak: 379.2M)
CPU: 1.737s
CGroup: /system.slice/mysql.service
└─2919 /usr/sbin/mysqld
By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script:
# mysql_secure_installation
Configure it like this:
- Set root password? [Y/n] Y
- Remove anonymous users? [Y/n] Y
- Disallow root login remotely? [Y/n] Y
- Remove test database and access to it? [Y/n] Y
- Reload privilege tables now? [Y/n] Y
Now run the command below to log in to the MySQL shell.
# mysql -u root -p
Once you are logged in to your database server to create a database, database user, and grant all privileges to the database user run the following commands:
mysql> CREATE DATABASE magentodb;
mysql> CREATE USER 'magentouser'@'localhost' IDENTIFIED BY 'Str0ngPa$$w0rd';
mysql> GRANT ALL ON magentodb.* TO 'magentouser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT
Step 5: Installing Elasticsearch
Starting Magento 2.4, all installations must be configured to use Elasticsearch as the catalog search engine.
Docker is a platform designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all parts it needs, such as libraries and other dependencies, and ship it all out as one package. This ensures that the application runs reliably when moved from one computing environment to another.
Docker provides tools and a platform to manage these containers efficiently, allowing developers to focus on writing code without worrying about the environment in which their code will run.
In this tutorial, we will show you how to install Docker on Ubuntu 24.04 OS.
Step 1: Update Operating System
Update your Ubuntu 24.04 operating system to make sure all existing packages are up to date:
# apt update && apt upgrade
Step 2: Install Dependencies
Install the required packages to allow Ubuntu 24.04 to access the Docker repositories over HTTPS:
By default, Docker should start on boot. But if it doesn’t, you can enable it to start automatically at the next boot with the following command:
#systemctl enable docker
Step 6: Test Docker
Run a test Docker container to ensure everything is working correctly:
# docker run hello-world
This command downloads a test image from the Docker Hub repository and runs it in a container:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:53641cd209a4fecfc68e21a99871ce8c6920b2e7502df0a20671c6fccc73a7c6
Status: Downloaded newer image for hello-world:latest
Step 7: Using the Docker Command
To see only the active containers, run:
# docker ps
To list all containers, including the inactive ones, add the -a flag:
# docker ps -a
Start a stopped container the syntax is:
# docker start [container-ID | container-name]
Stop a running container the syntax is:
# docker stop [container-ID | container-name]
Remove an unnecessary container the syntax is:
# docker rm [container-ID | container-name]
To view all of the available subcommands use the following command:
# docker
Output:
Commands:
attach Attach local standard input, output, and error streams to a running container
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
export Export a container's filesystem as a tar archive
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
wait Block until one or more containers stop, then print their exit codes
Step 8: Run Docker without Sudo
If we want to use Docker without root privileges, you need to run the following command:
# usermod -aG docker $User
Note: “$USER” is just a place holder that needs to be replaced with your username.
After that, restart the system, and the changes will be applied.
Comments and Conclusion
Congratulations! You have successfully installed Docker on your Ubuntu 24.04 OS.
Also, you can check our tutorial how to install Portainer on Ubuntu OS. Portainer is a container management tool that provides a web-based graphical user interface (GUI) for managing Docker containers, images, networks, and volumes.
Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text. It’s widely used in various fields such as data science, machine learning, scientific computing, and education.
The term “Jupyter” is derived from the combination of three programming languages: Julia, Python, and R. These were the first languages supported by the Jupyter project, but now it supports many other programming languages through its interactive computing protocol.
In this tutorial, we will show you how to install Jupyter Notebook on Debian 12 OS with Apache web server
Step 1: Update Operating System
Update your Debian 12 operating system to the latest version with the following command:
# apt update && apt upgrade -y
Step 2: Install Pip on Debian 12
Python comes already installed by default on Debian 12. You can verify it by checking its version:
# python3 -V
Output:
Python 3.11.2
If it doesn’t, install Python with the following command:
# apt install python3
Then use the following command to install pip and venv on Debian 12:
# apt install python3-venv python3-pip
Verify your pip installation by checking its version:
# pip3 --version
Output:
pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)
Step 3: Install Jupyter Notebook Using Virtualenv
First, create a directory and switch to it with the commands below:
# mkdir /var/www/notebook
# cd /var/www/notebook
Before you install Jupyter Notebook, you first need to create a Python virtual environment.
# python3 -m venv notebook_env
Next, activate the virtual environment with the following command:
# source notebook_env/bin/activate
Next, install Jupyter Notebook using the following command:
(notebook_env) # pip install jupyter
Once the installation is completed, run the Jupyter Notebook with the following command:
(notebook_env) # jupyter notebook --allow-root
Press the CTRL+C to stop the Jupyter Notebook.
Step 4: Generate Jupyter Notebook Password
First, generate a Jupyter Notebook configuration file with the following command: