{"id":55598,"date":"2020-04-30T14:15:05","date_gmt":"2020-04-30T18:15:05","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=55598"},"modified":"2021-08-16T15:37:59","modified_gmt":"2021-08-16T19:37:59","slug":"how-to-install-apache-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/","title":{"rendered":"How to Install Apache on Ubuntu"},"content":{"rendered":"<p>Before you can start hosting websites from your <strong>Ubuntu<\/strong> server, you will first need to install <strong>web server software<\/strong>. This software will function as a handler for your server, allowing users to connect to the server over the public internet. While there are many different types of web server software available, one of the most popular is <strong>Apache<\/strong>. In this guide, we will outline how to install and configure Apache on your Ubuntu server <a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/connect-ssh\/\">via SSH<\/a>.  Please note that you will need <a href=\"https:\/\/www.inmotionhosting.com\/support\/amp\/obtain-root-access\/\">root access<\/a> to complete this guide. <\/p>\n\n\n\n<p>Topics Include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#install\">Installing Apache<\/a><\/li><li><a href=\"#configure\">Configuring UncomplicatedFirewall<\/a> <\/li><li><a href=\"#manage\">Managing Apache<\/a><\/li><li><a href=\"#test\">Testing Apache<\/a><\/li><\/ul>\n\n\n\n<p class=\"alert alert-info\">Install Apache on your <a href=\"https:\/\/www.inmotionhosting.com\/dedicated-servers\">Dedicated Hosting<\/a> server to start establishing your online presence today!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install\">Installing Apache<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\"><li>Before you can install Apache, you will first want to make sure to update the software package using the following command:<br><br> <pre>sudo apt update<\/pre> <\/li><li>Once the package has updated, you can then install Apache using the following command: <br><br><pre>sudo apt install apache2<\/pre><br>The installation process will prompt you to press a key to continue. Press the <strong>Y key<\/strong> and hit <strong>enter<\/strong>. <\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure\">Configuring UncomplicatedFirewall<\/h2>\n\n\n\n<p>Before Apache can start accepting connections, you need to allow the service in the Ubuntu firewall software, known as <strong>ufw<\/strong> or <strong>UncomplicatedFirewall<\/strong>. <\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li>If ufw is not already enabled, enable it with the following command:<br><br> <pre>sudo ufw enable<\/pre> <\/li><li>With ufw enabled, you can allow Apache connections using the following command:<br><br> <pre>sudo ufw allow 'Apache'<\/pre> <\/li><li>To confirm that the firewall is now allowing Apache connections, use the following command:<br><br> <pre>sudo ufw status<\/pre> <br>The output will then display which connections are now allowed in the firewall. <\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"manage\">Managing Apache<\/h2>\n\n\n\n<p>To <strong>check the status<\/strong> of the Apache service, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl status apache2<\/pre>\n\n\n\n<p>If Apache is running properly, it should say <strong>active<\/strong> in the output. <\/p>\n\n\n\n<p>Occasionally, making changes to your server may require you to <strong>restart<\/strong> Apache. You can do this via the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart apache2<\/pre>\n\n\n\n<p>If you want to restart Apache without dropping active connections, you can <strong>reload<\/strong> Apache with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl reload apache2 <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"test\">Testing Apache<\/h2>\n\n\n\n<ul class=\"article_list wp-block-list\"><li>To confirm that Apache is installed properly and accepting connections over the public internet, you can test it by visiting your <strong>server IP address<\/strong> in your browser. For example, if your server IP is 123.456.789.0, you would navigate to this URL in your browser:<br><br><pre>https:\/\/ 123.456.789.0<\/pre><br><\/li><li>If the installation process was successful, you should see the following splash page:<br><br><a href=\"\/support\/wp-content\/uploads\/2020\/04\/apacheubuntu2.png\"><img decoding=\"async\" class=\"std_ss alignnone wp-image-6525 size-thumbnail\" src=\"\/support\/wp-content\/uploads\/2020\/04\/apacheubuntu2.png\" alt=\"Apache Ubuntu Splash Page\" style=\"width: 300px;\"><\/a><\/li><\/ul>\n\n\n\n<p>Congratulations, you have now installed Apache on your Ubuntu server! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before you can start hosting websites from your Ubuntu server, you will first need to install web server software. This software will function as a handler for your server, allowing users to connect to the server over the public internet. While there are many different types of web server software available, one of the most<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4355],"tags":[],"class_list":["post-55598","post","type-post","status-publish","format-standard","hentry","category-apache"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Apache on Ubuntu | InMotion Hosting Support Center<\/title>\n<meta name=\"description\" content=\"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\" \/>\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 Ubuntu | InMotion Hosting Support Center\" \/>\n<meta property=\"og:description\" content=\"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-30T18:15:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-16T19:37:59+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"How to Install Apache on Ubuntu\",\"datePublished\":\"2020-04-30T18:15:05+00:00\",\"dateModified\":\"2021-08-16T19:37:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\"},\"wordCount\":381,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\",\"name\":\"How to Install Apache on Ubuntu | InMotion Hosting Support Center\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2020-04-30T18:15:05+00:00\",\"dateModified\":\"2021-08-16T19:37:59+00:00\",\"description\":\"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Apache on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Apache on Ubuntu | InMotion Hosting Support Center","description":"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.","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:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Apache on Ubuntu | InMotion Hosting Support Center","og_description":"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2020-04-30T18:15:05+00:00","article_modified_time":"2021-08-16T19:37:59+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"How to Install Apache on Ubuntu","datePublished":"2020-04-30T18:15:05+00:00","dateModified":"2021-08-16T19:37:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/"},"wordCount":381,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Apache"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/","name":"How to Install Apache on Ubuntu | InMotion Hosting Support Center","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2020-04-30T18:15:05+00:00","dateModified":"2021-08-16T19:37:59+00:00","description":"In this guide, we will outline how to configure and install Apache on Ubuntu via SSH as well as some common commands used in managing Apache.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/apache\/how-to-install-apache-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Install Apache on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/55598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=55598"}],"version-history":[{"count":32,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/55598\/revisions"}],"predecessor-version":[{"id":82935,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/55598\/revisions\/82935"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=55598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=55598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=55598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}