{"id":14815,"date":"2025-07-15T06:07:40","date_gmt":"2025-07-15T06:07:40","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=14815"},"modified":"2025-07-15T06:07:48","modified_gmt":"2025-07-15T06:07:48","slug":"how-to-install-apache-on-debian-12","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/","title":{"rendered":"How to Install Apache on Debian 12"},"content":{"rendered":"\n<p>Apache is renowned for its performance and reliability, as well as its strong security features and its ability to integrate in conjunction with various software elements. Debian 12, being a long-term support version, provides an extremely secure and stable environment for running services such as Apache. Together, they provide an ideal foundation for providing web-based content to people around the world.<\/p>\n\n\n\n<p>In light of its importance in this article, we will provide the steps to install Apache and set up a virtual host for Debian 12:<\/p>\n\n\n\n<p><strong>Table of Contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#How-to-Install-Apache-on-Debian-12\">How to Install Apache on Debian 12?<\/a><\/li>\n\n\n\n<li><a href=\"#How-to-Configure-Hosts-Using-Apache-on-Debian-12\">How to Configure Hosts Using Apache on Debian 12? <\/a><\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s start by installing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"How-to-Install-Apache-on-Debian-12\"><a id=\"post-14815-_23u3oow9mfrl\"><\/a>How to Install Apache on Debian 12?<\/h2>\n\n\n\n<p>The reason for the installation of Apache for Debian 12 is to set up a reliable, efficient web server that is able to handle the hosting requirements of websites and web applications. For installing Apache for Debian 12, follow the steps below:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_16qusos87b6m\"><\/a>Step 1: Update Packages List<\/h3>\n\n\n\n<p>Before installing any software, ensuring that you update the list of system packages is always a good idea.<\/p>\n\n\n\n<pre>sudo apt update &amp;&amp; sudo apt upgrade<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_5awuww23bki5\"><\/a><figure><img fetchpriority=\"high\" decoding=\"async\" width=\"1146\" height=\"465\" class=\"wp-image-14816\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-1.png\" style=\"\" alt=\"sudo apt update &amp;&amp; sudo apt upgrade\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-1.png 1146w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-1-300x122.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-1-1024x415.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-1-768x312.png 768w\" sizes=\"(max-width: 1146px) 100vw, 1146px\" \/><\/figure><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_r535c44h7lsq\"><\/a>Step 2: Install Apache<\/h3>\n\n\n\n<p>After the repositories are updated, install Apache through the command below:<\/p>\n\n\n\n<pre>sudo apt install apache2<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1148\" height=\"629\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-2.png\" alt=\"sudo apt install apache2\" class=\"wp-image-14817\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-2.png 1148w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-2-300x164.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-2-1024x561.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-2-768x421.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_84qb48vjid26\"><\/a>Step 3: Adjust the Firewall<\/h3>\n\n\n\n<p>Secure now, secure the Apache server by altering the settings for firewalls. It lets traffic through ports 80 as well as 443 run:<\/p>\n\n\n\n<pre>sudo ufw enable # Activate Firewall <br>sudo ufw allow 'Apache Full' # Allow Traffic<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_9gsft4g2x8d9\"><\/a>Step 4: Check Web Server<\/h3>\n\n\n\n<p>Now, authenticate that the standard Debian 12 Apache web page by navigating to the public IP address in the browser:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1397\" height=\"805\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-3.png\" alt=\"Apache default page\" class=\"wp-image-14818\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-3.png 1397w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-3-300x173.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-3-1024x590.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-3-768x443.png 768w\" sizes=\"(max-width: 1397px) 100vw, 1397px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Note<\/strong>: Users can locate the server&#8217;s IP address on their working machine using the following command:<\/p>\n\n\n\n<pre>hostname -I<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_dnk5utmitgj9\"><\/a><figure><img loading=\"lazy\" decoding=\"async\" width=\"1138\" height=\"160\" class=\"wp-image-14819\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-4.png\" style=\"\" alt=\"hostname -I\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-4.png 1138w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-4-300x42.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-4-1024x144.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-4-768x108.png 768w\" sizes=\"(max-width: 1138px) 100vw, 1138px\" \/><\/figure><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_leq6arjwmtt9\"><\/a>Step 5: Verify Apache Installation<\/h3>\n\n\n\n<p>Users may also examine the Apache services through the &#8220;systemctl&#8221; command with the &#8220;status&#8221; utility as below:<\/p>\n\n\n\n<pre>sudo systemctl status apache2<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1147\" height=\"594\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-5.png\" alt=\"sudo systemctl status apache2\" class=\"wp-image-14820\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-5.png 1147w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-5-300x155.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-5-1024x530.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-5-768x398.png 768w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_dqlc2zivtjzd\"><\/a>Optional: Configure Apache Services<\/h3>\n\n\n\n<p>To configure Apache, utilize the &#8220;systemctl&#8221; command:<\/p>\n\n\n\n<pre>sudo systemctl start apache2 # Start Apache <br>sudo systemctl enable apache2 # Enable Apache<\/pre>\n\n\n\n<p>All that is left from the installation. We&#8217;ll move on to the setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"How-to-Configure-Hosts-Using-Apache-on-Debian-12\"><a id=\"post-14815-_cmyotmx94v9b\"><\/a>How to Configure Hosts Using Apache on Debian 12?<\/h2>\n\n\n\n<p>The process of setting in place Virtual Hosts using Apache is an essential task for server administrators as well as web developers who want to host several websites on one server. To create virtual hosts with Apache to run Debian 12, follow the steps below:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_zeeemreoeooc\"><\/a>Step 1: Creating a Directory for Host Files<\/h3>\n\n\n\n<p>Create a folder for the site within &#8220;\/var\/www\/&#8221; and give the permissions. Let&#8217;s make the &#8220;debian12.com&#8221; directory as below:<\/p>\n\n\n\n<pre>sudo mkdir \/var\/www\/debian12.com<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1150\" height=\"96\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-6.png\" alt=\"sudo mkdir \/var\/www\/debian12.com\" class=\"wp-image-14821\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-6.png 1150w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-6-300x25.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-6-1024x85.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-6-768x64.png 768w\" sizes=\"(max-width: 1150px) 100vw, 1150px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Be sure to browse via &#8220;\/var\/www\/html&#8221; to find the default index.html file. Replace or alter it using your website&#8217;s files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_5jiy3oqs7q6i\"><\/a>Step 2: Assign Ownership of the Directory<\/h3>\n\n\n\n<p>After that, permit ownership of the folder:<\/p>\n\n\n\n<pre>sudo chown -R $USER:$USER \/var\/www\/debian12.com<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1144\" height=\"97\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-7.png\" alt=\"sudo chown -R $USER:$USER \/var\/www\/debian12.com\" class=\"wp-image-14822\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-7.png 1144w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-7-300x25.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-7-1024x87.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-7-768x65.png 768w\" sizes=\"(max-width: 1144px) 100vw, 1144px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_92m3v6xwd09\"><\/a>Step 3: Create a Webpage<\/h3>\n\n\n\n<p>It is the right time to build the web page titled &#8220;index.html&#8221; under the above-created &#8220;debian12.com&#8221; directory:<\/p>\n\n\n\n<pre>sudo nano \/var\/www\/debian12.com\/index.html<\/pre>\n\n\n\n<p>Incorporate the following lines into this .html file. The user can also display web content based on their preferences or requirements:<\/p>\n\n\n\n<pre>&lt;html&gt; <br>&lt;head&gt; <br>&lt;title&gt;Hello Debian12 Users&lt;\/title&gt; <br>&lt;\/head&gt; <br>&lt;body&gt; <br>&lt;h2&gt;Debian12 is empowering linux users&lt;\/h2&gt; <br>&lt;\/body&gt; <br>&lt;\/html&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1153\" height=\"364\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-8.png\" alt=\"sudo nano \/var\/www\/debian12.com\/index.html\" class=\"wp-image-14823\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-8.png 1153w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-8-300x95.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-8-1024x323.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-8-768x242.png 768w\" sizes=\"(max-width: 1153px) 100vw, 1153px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_e2rks3xq4xz\"><\/a>Step 4: Create a Host File<\/h3>\n\n\n\n<p>Now, edit the host file in &#8220;\/etc\/apache2\/sites-available\/your_domain.conf&#8221;. Our file is &#8220;debian12.com.conf&#8221;:<\/p>\n\n\n\n<pre>sudo nano \/etc\/apache2\/sites-available\/debian12.com.conf<\/pre>\n\n\n\n<p>Incorporate the following configuration into the file and replace &#8220;debian12.com&#8221; with your actual domain name:<\/p>\n\n\n\n<pre>&lt;VirtualHost *:80&gt; <br>ServerAdmin webmaster@localhost <br>ServerName debian12.com <br>ServerAlias www.debian12.com <br>DocumentRoot \/var\/www\/debian12.com <br>ErrorLog ${APACHE_LOG_DIR}\/error.log <br>CustomLog ${APACHE_LOG_DIR}\/access.log combined <br>&lt;\/VirtualHost&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1145\" height=\"648\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-9.png\" alt=\"sudo nano \/etc\/apache2\/sites-available\/debian12.com.conf\" class=\"wp-image-14824\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-9.png 1145w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-9-300x170.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-9-1024x580.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-9-768x435.png 768w\" sizes=\"(max-width: 1145px) 100vw, 1145px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_tni4rtrptcqn\"><\/a>Step 5: Enable the Virtual Host Files<\/h3>\n\n\n\n<p>Finally, enable new sites by specifying the host file:<\/p>\n\n\n\n<pre>sudo a2ensite debian12.com.conf<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1144\" height=\"233\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-10.png\" alt=\"sudo a2ensite debian12.com.conf\" class=\"wp-image-14825\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-10.png 1144w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-10-300x61.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-10-1024x209.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-10-768x156.png 768w\" sizes=\"(max-width: 1144px) 100vw, 1144px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>You can also disallow the default site through the below command by specifying the name of the file configuration:<\/p>\n\n\n\n<pre>sudo a2dissite 000-default.conf<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"197\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-11.png\" alt=\"sudo a2dissite 000-default.conf\" class=\"wp-image-14826\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-11.png 1148w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-11-300x51.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-11-1024x176.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-11-768x132.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_rehsdev3hp7\"><\/a>Step 6: Test Configuration Errors<\/h3>\n\n\n\n<p>Now verify for errors using the &#8220;apache2ctl&#8221; utility:<\/p>\n\n\n\n<pre>sudo apache2ctl configtest<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1138\" height=\"132\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-12.png\" alt=\"sudo apache2ctl configtest\" class=\"wp-image-14827\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-12.png 1138w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-12-300x35.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-12-1024x119.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-12-768x89.png 768w\" sizes=\"(max-width: 1138px) 100vw, 1138px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If they encounter any issues, include the server&#8217;s name along with the IP address inside the &#8220;servername.conf&#8221; configuration file, such as &#8220;10.0.2.15&#8221;:<\/p>\n\n\n\n<pre>sudo nano \/etc\/apache2\/conf-available\/servername.conf<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"598\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-13.png\" alt=\"sudo nano \/etc\/apache2\/conf-available\/servername.conf\" class=\"wp-image-14828\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-13.png 1148w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-13-300x156.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-13-1024x533.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-13-768x400.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Now, input the server name in the &#8220;\/etc\/apache2\/apache2.conf&#8221; file:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"600\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-14.png\" alt=\"sudo nano \/etc\/apache2\/conf-available\/servername.conf\" class=\"wp-image-14829\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-14.png 1148w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-14-300x157.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-14-1024x535.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-14-768x401.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_cfar5z9w4wyv\"><\/a>Step 7: Reload Apache<\/h3>\n\n\n\n<p>Users must restart their Apache service (for applying modifications) by using the systemctl command<\/p>\n\n\n\n<pre>sudo systemctl reload apache2<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1148\" height=\"100\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-15.png\" alt=\"sudo systemctl reload apache2\" class=\"wp-image-14830\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-15.png 1148w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-15-300x26.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-15-1024x89.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-15-768x67.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_dstrwiweff12\"><\/a>Step 8: Verification<\/h3>\n\n\n\n<p>Make sure that you have the name of your domain pointing at the IP address of your server in the web browser.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1395\" height=\"263\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-16.png\" alt=\"Apache test page\" class=\"wp-image-14831\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-16.png 1395w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-16-300x57.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-16-1024x193.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14815-16-768x145.png 768w\" sizes=\"(max-width: 1395px) 100vw, 1395px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-14815-_cwbmzxeecs3t\"><\/a>Optional: Secure Apache With Encryption<\/h3>\n\n\n\n<p>Protect your website with an SSL\/TLS certificate for free from Encryption.<\/p>\n\n\n\n<pre>sudo apt install certbot python3-certbot-apache <br>sudo certbot --apache<\/pre>\n\n\n\n<p>If you follow these instructions, you&#8217;ll get an unassuming website running Apache within Debian 12. Your virtual hosts are in place and ready to be able to service the domain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-14815-_3xbhtehtaxku\"><\/a>Conclusion<\/h2>\n\n\n\n<p>To configure and install Apache for Debian 12, update system packages and install Apache by using the &#8220;sudo apt install apache2&#8221; command. Then, you must enable Apache to start on boot by using &#8220;sudo systemctl enable apache2&#8221;. To begin Apache, start the Apache service. You can use the&#8221;sudo systemctl start apache2&#8243; command. Finally, open the web browser and verify that Apache is running by visiting &#8220;<a href=\"http:\/\/your_server_ip\">http:\/\/your_server_ip<\/a>&#8220;.<\/p>\n\n\n\n<p>Following installation, the users are able to configure virtual hosts following the procedure above. This way, Apache has been successfully installed for Debian 12. After installation, users can set up virtual hosts by following the above procedure. In this way, Apache has been successfully installed as well as configured on Debian 12.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Apache is renowned for its performance and reliability, as well as its strong security features and its ability to integrate in conjunction with various software elements. Debian 12, being a long-term support version, provides an extremely secure and stable environment for running services such as Apache. Together, they provide an ideal foundation for providing web-based [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":14834,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-14815","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Apache on Debian 12 - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Apache on Debian 12 - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-15T06:07:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-15T06:07:48+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Install Apache on Debian 12\",\"datePublished\":\"2025-07-15T06:07:40+00:00\",\"dateModified\":\"2025-07-15T06:07:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\"},\"wordCount\":796,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg\",\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\",\"name\":\"How to Install Apache on Debian 12 - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg\",\"datePublished\":\"2025-07-15T06:07:40+00:00\",\"dateModified\":\"2025-07-15T06:07:48+00:00\",\"description\":\"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to install Apache on Debian 12\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Apache on Debian 12\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Apache on Debian 12 - Greenwebpage Community","description":"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Apache on Debian 12 - Greenwebpage Community","og_description":"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!","og_url":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/","og_site_name":"Greenwebpage Community","article_published_time":"2025-07-15T06:07:40+00:00","article_modified_time":"2025-07-15T06:07:48+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Install Apache on Debian 12","datePublished":"2025-07-15T06:07:40+00:00","dateModified":"2025-07-15T06:07:48+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/"},"wordCount":796,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/","url":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/","name":"How to Install Apache on Debian 12 - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg","datePublished":"2025-07-15T06:07:40+00:00","dateModified":"2025-07-15T06:07:48+00:00","description":"In this article, we will walk you through steps to install Apache web server on your Debian 12 . Keep reading!","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-install-Apache-on-Debian-12.jpg","width":1020,"height":600,"caption":"How to install Apache on Debian 12"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-apache-on-debian-12\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Install Apache on Debian 12"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=14815"}],"version-history":[{"count":2,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14815\/revisions"}],"predecessor-version":[{"id":14833,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14815\/revisions\/14833"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/14834"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=14815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=14815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=14815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}