{"id":15940,"date":"2022-01-14T07:08:46","date_gmt":"2022-01-14T07:08:46","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15940"},"modified":"2025-03-18T12:11:46","modified_gmt":"2025-03-18T12:11:46","slug":"how-to-install-wordpress-on-ubuntu","status":"publish","type":"post","link":"\/in\/tutorials\/how-to-install-wordpress-on-ubuntu","title":{"rendered":"How to Install WordPress on Ubuntu Automatically and With the LAMP Stack"},"content":{"rendered":"<p>WordPress hosting service lets you quickly set up the content management system (CMS) to create a website. While such a solution is easy to use, the web host usually limits you from choosing the web server and database.<\/p><p>If you&rsquo;re looking for extensive customization, you should install WordPress on a virtual private server (VPS) instead. This hosting type lets users choose any software to set up the CMS and tailor the server settings to their needs.<\/p><p>To help you get started, this tutorial will explain how to install WordPress on Ubuntu. We will provide two methods: automatically using the Hostinger VPS template and manually with commands.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-installing-wordpress-on-ubuntu\">Prerequisites for installing WordPress on Ubuntu<\/h2><p>Before installing WordPress, ensure your VPS is running Ubuntu since the commands differ for another Linux operating system.<\/p><p>To avoid incompatibility issues, <a href=\"\/in\/tutorials\/how-to-check-ubuntu-version\/\">check your Ubuntu version<\/a> and ensure you are running<strong> 22.04<\/strong> or later. Your VPS should also support software required for WordPress, like a web server and database.<\/p><p>Since WordPress is relatively lightweight, you can use an entry-level server like Hostinger&rsquo;s KVM 1 <a href=\"\/in\/vps-hosting\">VPS platform<\/a>. Starting at <strong>\u20b9599.00\/month<\/strong>, it offers<strong> 1 vCPU<\/strong> core, <strong>4 GB <\/strong>of RAM, and <strong>50 GB<\/strong> of NVMe SSD storage.<\/p><p>Hostinger VPS also supports Ubuntu and other software necessary for WordPress installation. Moreover, our operating system templates let you configure the CMS in one click. We will explain how to do so in the following section. <\/p><p>After purchasing a VPS, ensure you have <a href=\"\/in\/tutorials\/dns\/how-to-point-domain-to-vps\">pointed a domain name to your VPS<\/a> since we will use it to access the WordPress admin panel and finish the setup process.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-install-wordpress-on-ubuntu-automatically\">Install WordPress on Ubuntu automatically<\/h2><p>Hostinger VPS users can easily install WordPress via their web browser using the pre-configured <a href=\"https:\/\/support.hostinger.com\/en\/collections\/2797407-vps-os-and-templates?_gl=1*10bmo1*_gcl_aw*R0NMLjE3MjUzNTc4MDIuQ2p3S0NBanc1OXEyQmhCT0Vpd0FLYzBpaldtY212MFNYQWxtV29ndDVmbFJsX2hyU0RyTFM4VmNTRTRZZ1UzbW00RlpoWHVpSGpCV0Nob0N5ZThRQXZEX0J3RQ..*_gcl_au*MjA0ODEwMDA4NC4xNzI2NjU0MzU3\" target=\"_blank\" rel=\"noopener\">OS template<\/a>. This method is suitable for beginners since it doesn&rsquo;t use commands, making the process safer and simpler.<\/p><p>\n\n\n<div><p class=\"important\"><strong>Important!<\/strong> <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583232-how-to-back-up-or-restore-a-vps\" target=\"_blank\" rel=\"noopener\">Back up your VPS data<\/a> before installing an OS template since it will wipe all your data permanently. However, this step is unnecessary if you are using a new, empty server.<\/p><\/div>\n\n\n\n<\/p><p>Here&rsquo;s how to do so:<\/p><ol class=\"wp-block-list\">\n<li>Log in to <strong>hPanel <\/strong>and click <strong>VPS<\/strong> on the sidebar.<\/li>\n\n\n\n<li>Click <strong>Manage<\/strong> on the VPS you want to install WordPress.<\/li>\n\n\n\n<li>Navigate to the side panel &rarr; <strong>OS &amp; Panel <\/strong>&rarr; <strong>Operating System<\/strong>.<\/li>\n\n\n\n<li>In the operating system configuration menu, select <strong>Applications<\/strong> and choose <strong>WordPress<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0af9e62711\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"326\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/the-wordpress-template-on-hpanel-1024x326.png\" alt=\"The WordPress template on hPanel\" class=\"wp-image-119967\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/the-wordpress-template-on-hpanel-1024x326.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/the-wordpress-template-on-hpanel-300x96.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/the-wordpress-template-on-hpanel-150x48.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/the-wordpress-template-on-hpanel-768x245.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/the-wordpress-template-on-hpanel.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Click <strong>Change OS<\/strong> to confirm.<\/li>\n\n\n\n<li>Check the confirmation box to acknowledge that the installation will wipe your data. Click <strong>Next<\/strong>.<\/li>\n\n\n\n<li>Enter a new <strong>Panel password<\/strong> and click <strong>Confirm<\/strong>.<\/li>\n<\/ol><p>Wait until the installation process is finished, which should take a few minutes. That&rsquo;s it! You can now access the WordPress admin area by visiting this address. Remember to replace the VPS hostname with the actual value:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/your-vps-hostname\/wp-admin<\/pre><p>If the address doesn&rsquo;t work, <a href=\"\/in\/tutorials\/how-to-edit-hosts-file\">edit your system&rsquo;s hosts file<\/a> and add your VPS IP address with its hostname. If you have connected a domain, you can also access the page with the following address:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/domain.tld\/wp-admin&amp;<\/pre><p>Note that you can&rsquo;t choose the web server and database solution if you configure WordPress using Hostinger&rsquo;s OS template.<\/p><h2 class=\"wp-block-heading\" id=\"h-install-wordpress-on-ubuntu-using-a-lamp-stack\">Install WordPress on Ubuntu using a LAMP stack<\/h2><p>Installing WordPress manually using commands is suitable if you need specific software for your website. For example, if you want to use Apache and MySQL, <a href=\"\/in\/tutorials\/how-to-install-lamp-on-ubuntu\">set up the LAMP stack on your Ubuntu server<\/a>.<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro tip<\/h4>\n                    <p>Hostinger VPS also offers a template that automates Ubuntu and LAMP stack setup, which you can install from the same menu as the WordPress one.<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\">1. Connect to your server and create an account<\/h3><p>Before installing WordPress, connect to your VPS <a href=\"\/in\/tutorials\/how-to-use-putty-ssh\">using the PuTTY SSH client<\/a> and create a new user. Alternatively, Hostinger users can easily access their system&rsquo;s command-line interface via a web browser using the <strong>Browser terminal<\/strong>.<\/p><p>You will connect as <strong>root<\/strong> by default. However, using this account to manage your VPS can be unsafe since it can run any command without confirmation, including those that can alter important system settings.<\/p><p>Using a new user helps minimize the risk since it requires the <strong>sudo<\/strong> prefix and password to execute commands. To create one, run the following and replace username with your desired value:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">adduser username<\/pre><p>Add the user into the <strong>sudoers<\/strong> group to grant the superuser privilege:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">usermod -a -G sudo username<\/pre><p>Switch from <strong>root <\/strong>to the new user using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">su username<\/pre><p>Enter <strong>cd <\/strong>to return to your system&rsquo;s main directory.<\/p><h3 class=\"wp-block-heading\">2. Install WordPress dependencies<\/h3><p>Once logged in to your server as a superuser, update your system repository to ensure you get the latest version of all packages. Here&rsquo;s the command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update<\/pre><p>Now, install WordPress&rsquo;s dependencies &ndash; packages required for the platform to function properly. Here is the list:<\/p><ul class=\"wp-block-list\">\n<li><strong>Apache <\/strong>&ndash; a web server that takes and processes user requests, enabling your WordPress instance to be accessible online.<\/li>\n\n\n\n<li><strong>MySQL <\/strong>&ndash; a database for storing your WordPress data.<\/li>\n\n\n\n<li><strong>PHP and its modules <\/strong>&ndash; a programming language that interprets WordPress and enables WordPress to run on your server.<\/li>\n<\/ul><p>To install all the dependencies, run the following command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install apache2 ghostscript libapache2-mod-php mysql-server php php-bcmath php-curl php-imagick php-intl php-json php-mbstring php-mysql php-xml php-zip<\/pre><h3 class=\"wp-block-heading\" id=\"h-3-download-and-install-wordpress\">3. Download and install WordPress<\/h3><p>Now we can proceed with the WordPress installation. To begin, create a folder called \/srv\/www using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mkdir -p \/srv\/www<\/pre><p>This folder will contain all your WordPress website files. Now, assign your web server as the folder owner so the data is accessible online. Here&rsquo;s the command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo chown www-data: \/srv\/www<\/pre><p>Then, download and extract the WordPress installation package using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl https:\/\/wordpress.org\/latest.tar.gz | sudo -u www-data tar zx -C \/srv\/www<\/pre><h3 class=\"wp-block-heading\">4. Configure the Apache web server<\/h3><p>Set up your Apache web server so it can serve the WordPress files online. To do so, create a configuration file <a href=\"\/in\/tutorials\/how-to-install-and-use-nano-text-editor\">using the nano file editor<\/a>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo nano \/etc\/apache2\/sites-available\/wordpress.conf<\/pre><p>Then, copy and paste the following configuration into the file. Once finished, hit<strong> Ctrl<\/strong> +<strong> X<\/strong>, <strong>Y<\/strong>, and <strong>Enter <\/strong>to save the changes.<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:80&gt;\n    DocumentRoot \/srv\/www\/wordpress\n    &lt;Directory \/srv\/www\/wordpress&gt;\n        Options FollowSymLinks\n        AllowOverride Limit Options FileInfo\n        DirectoryIndex index.php\n        Require all granted\n    &lt;\/Directory&gt;\n    &lt;Directory \/srv\/www\/wordpress\/wp-content&gt;\n        Options FollowSymLinks\n        Require all granted\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;<\/pre><p>Enable the WordPress site configuration so Apache can serve it by running these commands:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo a2ensite wordpress<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo a2enmod rewrite<\/pre><p>Next, disable the default Apache site so your web server will display the correct WordPress page by entering this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo a2dissite 000-default<\/pre><p>Refresh Apache to ensure all changes are applied properly:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo service apache2 reload<\/pre><h3 class=\"wp-block-heading\">5. Set up the MySQL database<\/h3><p>Set up a new MySQL database for your WordPress site to store and fetch user data. To do so, enter the SQL shell using the default root account by running:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mysql -u root<\/pre><p>Then, create a new database. In this tutorial, we will call it <strong>wordpress:<\/strong><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE DATABASE wordpress;<\/pre><p>Set up a new user for the wordpress database. Remember to replace <strong>your-password <\/strong>with the actual credential:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE USER wordpress@localhost IDENTIFIED BY 'your-password';<\/pre><p>Grant the user permission to access and modify the database by running the following:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO wordpress@localhost;<\/pre><p>Flush the database privileges to apply the changes:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">FLUSH PRIVILEGES;<\/pre><p>Exit the SQL shell using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">quit<\/pre><h3 class=\"wp-block-heading\">6. Configure phpMyAdmin<\/h3><p>In addition to MySQL, we will also install phpMyAdmin, a database administration panel that offers a graphical user interface to simplify management tasks. To do so, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install phpmyadmin<\/pre><p>Hit <strong>Space <\/strong>to check Apache as your web server and confirm using <strong>Enter<\/strong>. Then, set the phpMyAdmin panel password. After completing the configuration, enable the <strong>PHP Mbstring <\/strong>extension using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo phpenmod mbstring<\/pre><p>Restart Apache to apply the changes using this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl restart apache2<\/pre><p>Now, log in to MySQL root account by entering the following. Enter the password you created during the phpMyAdmin installation:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mysql -u root -p<\/pre><p>Then, run the following command to grant phpMyAdmin privilege to enable database connection:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost';<\/pre><p>Flush the privileges to refresh the configuration and enter <strong>quit <\/strong>to close the MySQL shell. To check whether phpMyAdmin is configured correctly, enter the following address in your web browser:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/domain.tld\/phpmyadmin<\/pre><p>Remember to replace the domain with the actual value. On the login page, enter phpMyAdmin as the username and use the password you set during the panel installation.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0af9e64283\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"635\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/the-phpmyadmin-login-page-1024x635.png\" alt=\"The phpMyAdmin login page\" class=\"wp-image-109969\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/the-phpmyadmin-login-page-1024x635.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/the-phpmyadmin-login-page-300x186.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/the-phpmyadmin-login-page-150x93.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/the-phpmyadmin-login-page-768x477.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/the-phpmyadmin-login-page.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>\n\n<div><p class=\"important\"><strong>Important!<\/strong><br>\nIf you encounter the &ldquo;URL not found&rdquo; error, run <strong>sudo dpkg-reconfigure phpmyadmin<\/strong> to rerun the installation and tick Apache by pressing space. Meanwhile, ensure you assign the correct user to the MySQL database if facing login issues.<\/p><\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\">7. Complete the WordPress setup wizard<\/h3><p>The last step is to complete the WordPress setup from your web browser. Visit the following address with <strong>domain.tld <\/strong>being your actual domain name:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/domain.tld\/wp-admin<\/pre><p>Click <strong>Let&rsquo;s Go<\/strong>, and WordPress will ask you to enter information about your database. Enter the credentials you have created in the previous steps, but leave out the <strong>host <\/strong>and<strong> prefix<\/strong> fields. Click <strong>Submit <\/strong>once finished.<\/p><p>In the next screen, hit <strong>Run the installation<\/strong>. Enter information about your WordPress <strong>username<\/strong>, <strong>password<\/strong>, <strong>site title<\/strong>, and <strong>admin email address<\/strong>. Ensure you uncheck the &ldquo;<strong>Discourage search engines from indexing this site<\/strong>&rdquo; to make your website discoverable on the search engine result pages.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0af9e64ce1\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"778\" height=\"881\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/site-information-forms-in-the-wordpress-installation-wizard.png\" alt=\"Site information forms in the WordPress installation wizard\" class=\"wp-image-109970\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/site-information-forms-in-the-wordpress-installation-wizard.png 778w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/site-information-forms-in-the-wordpress-installation-wizard-265x300.png 265w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/site-information-forms-in-the-wordpress-installation-wizard-132x150.png 132w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/05\/site-information-forms-in-the-wordpress-installation-wizard-768x870.png 768w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Click <strong>Install WordPress<\/strong> to proceed with the setup. Once finished, click <strong>Log in<\/strong> on the confirmation screen and enter your account credentials to access the WordPress dashboard. That&rsquo;s it! You can now start creating your website using the CMS.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Hosting WordPress on a VPS provides more flexibility over dedicated CMS hosting since you can choose different web servers and database solutions. However, installing it can be difficult due to the need for commands.<\/p><p>Hostinger VPS users can easily install WordPress on an Ubuntu server without commands by selecting the<strong> WordPress <\/strong>template in <strong>hPanel<\/strong>&rsquo;s operating system menu. Then, visit the VPS hostname followed by <strong>\/wp-admin<\/strong> to access the dashboard.<\/p><p>Another method is to configure WordPress with LAMP stack using commands. After connecting to your server via SSH, install all the dependencies, including the Apache web server and MySQL database.<\/p><p>Once the web stack is set, download the WordPress installation and unpack it. Configure Apache and visit your domain name followed by <strong>\/wp-admin<\/strong> to initiate the setup wizard.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-install-wordpress-on-ubuntu-faq\">How to Install WordPress on Ubuntu FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1715851494183\"><h3 class=\"schema-faq-question\">Can I Install WordPress on Ubuntu Without Using the Command Line?<\/h3> <p class=\"schema-faq-answer\">Yes! Hostinger users can install WordPress on Ubuntu without commands using our operating system template. To do so, log in to <strong>hPanel <\/strong>and manage the VPS in question. Navigate to the operating system configuration menu and select the <strong>WordPress <\/strong>template.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1715851503097\"><h3 class=\"schema-faq-question\">How Do I Secure My WordPress Site on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">Apply robust safety measures on your VPS, including <a href=\"\/in\/tutorials\/how-to-configure-firewall-on-ubuntu-using-ufw\">enabling a firewall<\/a>, installing SSL, and setting up <strong>Fail2Ban<\/strong>. To <a href=\"\/in\/tutorials\/how-to-secure-wordpress\">secure WordPress<\/a>, install plugins like Wordfence, avoid untrusted extensions, regularly update the core files, and set up a blocklist.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1715851507007\"><h3 class=\"schema-faq-question\">How Can I Access My WordPress Site After Installation?<\/h3> <p class=\"schema-faq-answer\">To access your WordPress site after installation, simply visit your VPS domain in a web browser. If you haven&rsquo;t completed the setup wizard, add <strong>\/wp-admin<\/strong> at the end of the URL. If you have finished the setup, using<strong> \/wp-admin <\/strong>will open the WordPress dashboard page.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>WordPress hosting service lets you quickly set up the content management system (CMS) to create a website. While such a solution is easy to use, the web host usually limits you from choosing the web server and database. If you&rsquo;re looking for extensive customization, you should install WordPress on a virtual private server (VPS) instead. [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/how-to-install-wordpress-on-ubuntu\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","footnotes":""},"categories":[22642,22640],"tags":[],"class_list":["post-15940","post","type-post","status-publish","format-standard","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-instalar-wordpress-ubuntu","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/instalar-wordpress-ubuntu","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/instalar-wordpress-ubuntu","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/instalar-wordpress-ubuntu","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/instalar-wordpress-ubuntu","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-instalar-wordpress-ubuntu","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-wordpress-on-ubuntu","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/15940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=15940"}],"version-history":[{"count":41,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/15940\/revisions"}],"predecessor-version":[{"id":125155,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/15940\/revisions\/125155"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=15940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=15940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=15940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}