{"id":578,"date":"2018-10-09T19:25:04","date_gmt":"2018-10-09T19:25:04","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=578"},"modified":"2024-01-18T13:55:55","modified_gmt":"2024-01-18T13:55:55","slug":"install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/","title":{"rendered":"Install Linux, Nginx, MariaDB &#038; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS"},"content":{"rendered":"<p><strong>LEMP Stack<\/strong> is a group of popular software that you can use together to serve dynamic web pages. <strong>LEMP<\/strong> stands for<strong> Linux, Nginx (Engine-X), MySQL and PHP<\/strong>.<\/p>\n<p>As you may have noticed, the title says we\u2019re going to install MariaDB, and not MySQL. MariaDB is regarded as having increased performance over MySQL, <a href=\"https:\/\/www.google.com\/search?q=mariadb+vs+mysql&amp;pws=0&amp;gl=us&amp;gws_rd=cr\" target=\"_blank\" rel=\"noopener\">but you can check out comparisons for yourself<\/a>.<\/p>\n<p>If you\u2019d like to host a CMS such as WordPress or Joomla on a VPS, for example, then <strong>LEMP<\/strong> is a great choice to host and serve your website. The backend data is stored in MariaDB, while the dynamic processing is handled by PHP.<\/p>\n\n<h2 id=\"step-1-install-nginx-web-server\">Step 1: Install Nginx Web Server<\/h2>\n<p>Nginx is a fast and efficient web server. A Web Server basically displays web pages to our visitors.<\/p>\n<p>The software we\u2019re installing is already in Ubuntu\u2019s default repositories so all we have to do is run the <code>apt<\/code> suite, and since this is the first time we\u2019re using it, we\u2019ll start by updating our package index to make sure we\u2019re using the latest package listings. After that, we\u2019ll install the server.<\/p>\n<pre><code>$ sudo apt update\r\n$ sudo apt install nginx<\/code><\/pre>\n<div class=\"showyourterms regular nostatusbar\" data-title=\"root@draculaservers\">\n<div class=\"command\" data-action=\"command\" data-delay=\"400\" data-speed=\"50\">sudo&nbsp;apt&nbsp;install&nbsp;nginx<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Reading&nbsp;package&nbsp;lists&#8230;&nbsp;Done<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Building&nbsp;dependency&nbsp;tree<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Reading&nbsp;state&nbsp;information&#8230;&nbsp;Done<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">The&nbsp;following&nbsp;NEW&nbsp;packages&nbsp;will&nbsp;be&nbsp;installed:<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">nginx<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">0&nbsp;upgraded,&nbsp;1&nbsp;newly&nbsp;installed,&nbsp;0&nbsp;to&nbsp;remove&nbsp;and&nbsp;94&nbsp;not&nbsp;upgraded.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Need&nbsp;to&nbsp;get&nbsp;0&nbsp;B\/3,588&nbsp;B&nbsp;of&nbsp;archives.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">After&nbsp;this&nbsp;operation,&nbsp;43.0&nbsp;kB&nbsp;of&nbsp;additional&nbsp;disk&nbsp;space&nbsp;will&nbsp;be&nbsp;used.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Selecting&nbsp;previously&nbsp;unselected&nbsp;package&nbsp;nginx.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">(Reading&nbsp;database&nbsp;&#8230;&nbsp;59092&nbsp;files&nbsp;and&nbsp;directories&nbsp;currently&nbsp;installed.)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Preparing&nbsp;to&nbsp;unpack&nbsp;&#8230;\/nginx_1.14.0-0ubuntu1.1_all.deb&nbsp;&#8230;<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Unpacking&nbsp;nginx&nbsp;(1.14.0-0ubuntu1.1)&nbsp;&#8230;<\/div><div class=\"line\" data-delay=\"10000\" data-speed=\"50\">Setting&nbsp;up&nbsp;nginx&nbsp;(1.14.0-0ubuntu1.1)&nbsp;&#8230;<\/div>   <\/div>\n<p>Check if it\u2019s working by typing:<\/p>\n<pre><code>$ systemctl status nginx<\/code><\/pre>\n<div class=\"showyourterms regular nostatusbar\" data-title=\"root@draculaservers\">\n<div class=\"command\" data-action=\"command\" data-delay=\"400\" data-speed=\"50\">systemctl&nbsp;status&nbsp;nginx<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">\u25cf&nbsp;nginx.service&nbsp;--&nbsp;A&nbsp;high&nbsp;performance&nbsp;web&nbsp;server&nbsp;and&nbsp;a&nbsp;reverse&nbsp;proxy&nbsp;server<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Loaded:&nbsp;loaded&nbsp;(\/lib\/systemd\/system\/nginx.service;&nbsp;enabled;&nbsp;vendor&nbsp;preset:&nbsp;enabled)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Active:&nbsp;active&nbsp;(running)&nbsp;since&nbsp;Fri&nbsp;2018-10-05&nbsp;14:59:55&nbsp;PDT;&nbsp;21h&nbsp;ago<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Docs:&nbsp;man:nginx(8)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Main&nbsp;PID:&nbsp;1542&nbsp;(nginx)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Tasks:&nbsp;2&nbsp;(limit:&nbsp;2270)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">CGroup:&nbsp;\/system.slice\/nginx.service<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">\u251c\u25001542&nbsp;nginx:&nbsp;master&nbsp;process&nbsp;\/usr\/sbin\/nginx&nbsp;-g&nbsp;daemon&nbsp;on;&nbsp;master_process&nbsp;on;<\/div><div class=\"line\" data-delay=\"10000\" data-speed=\"50\">\u2514\u25001543&nbsp;nginx:&nbsp;worker&nbsp;process<\/div>   <\/div>\n<p>The best way to check is by visiting your IP or domain name. If it\u2019s working, then you\u2019ll see the default page included when you install Nginx.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-565\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page.png\" alt=\"nginx_default_page\" width=\"963\" height=\"380\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page.png 963w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page-300x118.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page-768x303.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/p>\n<h2 id=\"step-2-install-mariadb\">Step 2: Install MariaDB<\/h2>\n<p>Run the command:<\/p>\n<pre><code>$ sudo apt install mariadb-server<\/code><\/pre>\n<p>Next, secure your MariaDB installation.<\/p>\n<pre><code>$ sudo mysql_secure_installation<\/code><\/pre>\n<div class=\"showyourterms regular nostatusbar\" data-title=\"root@draculaservers\">\n<div class=\"command\" data-action=\"command\" data-delay=\"400\" data-speed=\"50\">sudo&nbsp;mysql_secure_installation<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">NOTE:&nbsp;RUNNING&nbsp;ALL&nbsp;PARTS&nbsp;OF&nbsp;THIS&nbsp;SCRIPT&nbsp;IS&nbsp;RECOMMENDED&nbsp;FOR&nbsp;ALL&nbsp;MariaDB<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">SERVERS&nbsp;IN&nbsp;PRODUCTION&nbsp;USE!&nbsp;PLEASE&nbsp;READ&nbsp;EACH&nbsp;STEP&nbsp;CAREFULLY!<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">In&nbsp;order&nbsp;to&nbsp;log&nbsp;into&nbsp;MariaDB&nbsp;to&nbsp;secure&nbsp;it,&nbsp;we&#8217;ll&nbsp;need&nbsp;the&nbsp;current<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">password&nbsp;for&nbsp;the&nbsp;root&nbsp;user.&nbsp;If&nbsp;you&#8217;ve&nbsp;just&nbsp;installed&nbsp;MariaDB,&nbsp;and<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">you&nbsp;haven&#8217;t&nbsp;set&nbsp;the&nbsp;root&nbsp;password&nbsp;yet,&nbsp;the&nbsp;password&nbsp;will&nbsp;be&nbsp;blank,<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">so&nbsp;you&nbsp;should&nbsp;just&nbsp;press&nbsp;enter&nbsp;here.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Enter&nbsp;current&nbsp;password&nbsp;for&nbsp;root&nbsp;(enter&nbsp;for&nbsp;none):<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">OK,&nbsp;successfully&nbsp;used&nbsp;password,&nbsp;moving&nbsp;on&#8230;<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Setting&nbsp;the&nbsp;root&nbsp;password&nbsp;ensures&nbsp;that&nbsp;nobody&nbsp;can&nbsp;log&nbsp;into&nbsp;the&nbsp;MariaDB<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">root&nbsp;user&nbsp;without&nbsp;the&nbsp;proper&nbsp;authorisation.<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Set&nbsp;root&nbsp;password?&nbsp;[Y\/n]&nbsp;Y<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">New&nbsp;password:<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Re-enter&nbsp;new&nbsp;password:<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Password&nbsp;updated&nbsp;successfully!<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Reloading&nbsp;privilege&nbsp;tables..<\/div><div class=\"line\" data-delay=\"10000\" data-speed=\"50\">&#8230;&nbsp;Success!<\/div>   <\/div>\n<p>If you haven\u2019t set a MariaDB password already and are prompted with <code>Enter current password for root (enter for none)<\/code> then just hit enter to move on &#8211; you\u2019ll set the password next.<\/p>\n<p>You should be prompted to set the root password for MariaDB. Answer <code>Y<\/code> to this.<\/p>\n<p><code>Set root password? [Y\/n]<\/code><\/p>\n<p>And set your password. Make sure it\u2019s different than your SSH password, for security reasons.<\/p>\n<pre><code>Set root password? [Y\/n] Y\r\nNew password: \r\nRe-enter new password: \r\nPassword updated successfully!\r\nReloading privilege tables..\r\n... Success!<\/code><\/pre>\n<p>Test if MariaDB is set up properly. Type in the following command to run it, and enter the password you just set at the prompt:<\/p>\n<pre><code>$ sudo mysql -u root -p<\/code><\/pre>\n<p>If successful you should see a welcome message.<\/p>\n<pre><code>Enter password: \r\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\r\nYour MariaDB connection id is 49\r\nServer version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]&gt;<\/code><\/pre>\n<h2 id=\"step-3-install-php7-3-and-configure-nginx-to-use-the-php-processor-for-dynamic-content\">Step 3: Install PHP7.3 and Configure Nginx to use the PHP Processor for Dynamic Content<\/h2>\n<blockquote class=\"note\"><p><small><strong>Update: <\/strong>We&#8217;ve updated the guide to installing PHP7.3 since it&#8217;s the latest version.<\/small><\/p><\/blockquote>\n<p>Now that you\u2019ve got Nginx to serve pages and MariaDB to handle your data, you\u2019ll need something to generate dynamic pages. This is where PHP comes in.<\/p>\n<p>Nginx does not come with PHP processing so we\u2019ll have to install it ourselves. We\u2019ll be installing <code>php-fpm<\/code>, which stands for <strong>PHP FastCGI Process Manager<\/strong>, and then we\u2019ll tell Nginx to pass requests to PHP for processing.<\/p>\n<p>We&#8217;ll first have to add a third party repository to be able to install PHP7.3. You may not have the <code>add-apt-repository<\/code> command available, so we&#8217;ll install <code>software-properties-common<\/code> first. To do both of these things, run the following command:<\/p>\n<pre><code>$ sudo apt-get install software-properties-common\r\n$ sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\n<p>With the new repository added, now just update your package index:<\/p>\n<pre><code>$ sudo apt update<\/code><\/pre>\n<p>Now we can install PHP7.3 and some common extensions for it. We&#8217;re also installing these extensions because you&#8217;ll find that many software like CMS ( WordPress, Joomla etc) require these extensions from time to time, so it&#8217;s good to have them readily installed.<\/p>\n<pre><code>$ sudo apt install php7.3 php7.3-fpm php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl<\/code><\/pre>\n<p>After you&#8217;ve installed PHP7.3, you can start it, enable auto-start on boot, and check it&#8217;s status. You can do this with the following commands:<\/p>\n<pre><code>sudo systemctl start php7.3-fpm\r\nsudo systemctl enable php7.3-fpm\r\nsystemctl status php7.3-fpm<\/code><\/pre>\n<blockquote class=\"note\"><p><small><strong>NOTE: <\/strong>If you find that the cursor gets stuck in the <code>status<\/code> output, you can press <code>q<\/code> for <code>quit<\/code> and it&#8217;ll go back to normal.<\/small><\/p><\/blockquote>\n<p>Now you\u2019ve got all the components of the LEMP Stack, but we still have to tell Nginx to use PHP for dynamic content.<\/p>\n<p>This will be done at the server block level. To tell Nginx to use PHP we\u2019ll edit our website\u2019s server block. We\u2019ll create a new server block in the <code>\/etc\/nginx\/sites-available<\/code> directory. We\u2019ll assume that we\u2019ve got the domain <code>example.com<\/code>. You can use whatever you\u2019d like instead of <code>example.com<\/code>, however we recommend you use your own domain or your server\u2019s IP.<\/p>\n<pre><code>$ sudo nano \/etc\/nginx\/sites-available\/example.com<\/code><\/pre>\n<p>We\u2019re not editing the default server block, but are creating a new one because it\u2019ll be easier to get back to the initial configuration if we need to.<\/p>\n<p>Now add the following content to your new server block &#8211; it\u2019s a slightly modified version of the initial one.<\/p>\n<pre title=\"\/etc\/nginx\/sites-available\/example.com\"><code>server {\r\n    listen 80;\r\n    root \/var\/www\/html;\r\n    index index.php index.html index.htm index.nginx-debian.html;\r\n    \r\n    server_name example.com;\r\n    \r\n    location \/ {\r\n        try_files $uri $uri\/ =404;\r\n    }\r\n    \r\n    location ~ \\.php$ {\r\n        include snippets\/fastcgi-php.conf;\r\n        fastcgi_pass unix:\/var\/run\/php\/php7.3-fpm.sock;\r\n    }\r\n    \r\n    location ~ \/\\.ht {\r\n        deny all;\r\n    }\r\n}<\/code><\/pre>\n<p>Save and close the file when you\u2019re finished.<\/p>\n<p>Now we\u2019ll have to enable the server block in <code>\/etc\/nginx\/sites-enabled<\/code>. We do this by linking the file from the <code>\/etc\/nginx\/sites-available<\/code> directory.<\/p>\n<pre><code>$ sudo ln -s \/etc\/nginx\/sites-available\/example.com \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Everything should be set up. Let\u2019s test it out in the command line:<\/p>\n<pre><code>$ sudo nginx -t<\/code><\/pre>\n<p>If there are any errors then go back through the tutorial and check if you did everything correctly. If not, leave a comment and we\u2019ll try to help.<\/p>\n<p>Reload Nginx to apply the changes you made:<\/p>\n<pre><code>$ sudo systemctl reload nginx<\/code><\/pre>\n<p>You\u2019ve finished installing LEMP Stack. There\u2019s one more easy thing we should do to make sure everything\u2019s working properly.<\/p>\n<h2 id=\"step-4-testing-php-processing\">Step 4: Testing PHP Processing<\/h2>\n<p>Everything should be set up, but we should check that Nginx is communicating with PHP.<\/p>\n<p>To do this we\u2019ll create a simple PHP file that Nginx will serve us and we\u2019ll see in the browser that PHP is generating pages.<\/p>\n<p>Create a test <code>php<\/code> file in your Nginx document root:<\/p>\n<pre><code>$ sudo nano \/var\/www\/html\/info.php<\/code><\/pre>\n<p>Now add the following content. This is valid PHP code that generates a page containing information about our server:<\/p>\n<pre>&lt;?php\r\nphpinfo(); ?&gt;<\/pre>\n<p>Save and close the file when you\u2019re finished.<\/p>\n<p>Now visit the page by typing <code>https:\/\/yourdomain_or_IP\/info.php<\/code> in your browser.<\/p>\n<p>You should see a page generated by PHP and containing structured information about your server.<\/p>\n<p>If you see this page then Nginx is successfully communicating with PHP.<\/p>\n<p>One more thing that you have to do is remove <code>\/var\/www\/html\/info.php<\/code>. This is because it makes your server vulnerable and others can see important information about your server &#8211; and we don\u2019 want that.<\/p>\n<p>Simply remove the file:<\/p>\n<pre>$ sudo rm \/var\/www\/html\/info.php<\/pre>\n<p>With that we can conclude that you\u2019ve successfully installed LEMP Stack. Congratulations!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LEMP Stack is a group of popular software that you can use together to serve dynamic web pages. LEMP stands for Linux, Nginx (Engine-X), MySQL and PHP. As you may have noticed, the title says we\u2019re going to install MariaDB, and not MySQL. MariaDB is regarded as having increased performance over MySQL, but you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":592,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,6,2,22],"tags":[],"class_list":["post-578","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","category-hosting","category-linux-basics","category-ubuntu"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png",1024,512,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design-300x150.png",300,150,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design-768x384.png",768,384,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png",1024,512,false],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png",1024,512,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png",1024,512,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>LEMP Stack is a group of popular software that you can use together to serve dynamic web pages. LEMP stands for Linux, Nginx (Engine-X), MySQL and PHP. As you may have noticed, the title says we\u2019re going to install MariaDB, and not MySQL. MariaDB is regarded as having increased performance over MySQL, but you can check out comparisons for yourself. If you\u2019d like to host a CMS such as WordPress or Joomla on a VPS, for example, then LEMP is a great choice to host and serve your website. The backend data is stored in MariaDB, while the dynamic processing&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/getting-started\/\" rel=\"category tag\">Getting Started<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/hosting\/\" rel=\"category tag\">Hosting<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-basics\/\" rel=\"category tag\">Linux Basics<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/ubuntu\/\" rel=\"category tag\">Ubuntu<\/a>","author_info_v2":{"name":"Vlad","url":"https:\/\/draculaservers.com\/tutorials\/author\/vlad\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install LEMP Stack with MariaDB for Powerful Web Pages<\/title>\n<meta name=\"description\" content=\"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install LEMP Stack with MariaDB for Powerful Web Pages\" \/>\n<meta property=\"og:description\" content=\"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-09T19:25:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-18T13:55:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vlad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vlad\" \/>\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:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/\"},\"author\":{\"name\":\"Vlad\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\"},\"headline\":\"Install Linux, Nginx, MariaDB &#038; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS\",\"datePublished\":\"2018-10-09T19:25:04+00:00\",\"dateModified\":\"2024-01-18T13:55:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/\"},\"wordCount\":1256,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Untitled-design.png\",\"articleSection\":[\"Getting Started\",\"Hosting\",\"Linux Basics\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/\",\"name\":\"How to Install LEMP Stack with MariaDB for Powerful Web Pages\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Untitled-design.png\",\"datePublished\":\"2018-10-09T19:25:04+00:00\",\"dateModified\":\"2024-01-18T13:55:55+00:00\",\"description\":\"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Untitled-design.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Untitled-design.png\",\"width\":1024,\"height\":512,\"caption\":\"lemp_stack_ubuntu_install\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Linux, Nginx, MariaDB &#038; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\",\"name\":\"Vlad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"caption\":\"Vlad\"},\"description\":\"Tech Support\",\"sameAs\":[\"https:\\\/\\\/draculaservers.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install LEMP Stack with MariaDB for Powerful Web Pages","description":"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.","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:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/","og_locale":"en_US","og_type":"article","og_title":"How to Install LEMP Stack with MariaDB for Powerful Web Pages","og_description":"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.","og_url":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2018-10-09T19:25:04+00:00","article_modified_time":"2024-01-18T13:55:55+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png","type":"image\/png"}],"author":"Vlad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vlad","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/"},"author":{"name":"Vlad","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e"},"headline":"Install Linux, Nginx, MariaDB &#038; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS","datePublished":"2018-10-09T19:25:04+00:00","dateModified":"2024-01-18T13:55:55+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/"},"wordCount":1256,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png","articleSection":["Getting Started","Hosting","Linux Basics","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/","url":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/","name":"How to Install LEMP Stack with MariaDB for Powerful Web Pages","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png","datePublished":"2018-10-09T19:25:04+00:00","dateModified":"2024-01-18T13:55:55+00:00","description":"Learn how to set up a robust backend with MariaDB and dynamic processing using PHP, creating an ideal solution for hosting and serving your website efficiently.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/Untitled-design.png","width":1024,"height":512,"caption":"lemp_stack_ubuntu_install"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Install Linux, Nginx, MariaDB &#038; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e","name":"Vlad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","caption":"Vlad"},"description":"Tech Support","sameAs":["https:\/\/draculaservers.com"]}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=578"}],"version-history":[{"count":5,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/578\/revisions"}],"predecessor-version":[{"id":2703,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/578\/revisions\/2703"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/592"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}