{"id":2284,"date":"2017-09-22T13:43:21","date_gmt":"2017-09-22T10:43:21","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/install-magento-open-source-ubuntu\/"},"modified":"2017-09-22T13:43:21","modified_gmt":"2017-09-22T10:43:21","slug":"install-magento-open-source-ubuntu","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/install-magento-open-source-ubuntu\/","title":{"rendered":"How to Install Magento 2.4.6 on Ubuntu 22.04: Complete Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento Open Source is a flexible e-commerce platform for developers and small businesses. The free open-source edition comes with the performance and features to meet the requirements of the businesses of today. It is the perfect platform for growing small business sites or anyone who wishes to learn and experiment with building an online store.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/signup.upcloud.com\/\">Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Deploying a cloud server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you have not already registered with UpCloud, you should <a href=\"https:\/\/signup.upcloud.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">begin by getting signed up<\/a>. Take a moment to create an account after which you can easily deploy your own cloud servers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have signed up, log into your <a href=\"https:\/\/hub.upcloud.com\/deploy\" target=\"_blank\" rel=\"noopener\">UpCloud control panel<\/a> and deploy a server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Deploy a new cloud instance for hosting the Magento site, select an availability zone of your choosing and the Ubuntu 22.04 LTS from the Public Templates. Using Ubuntu 22.04 LTS ensures access to the latest security updates and performance improvements. You can find in-depth instructions on all of the configuration options at the guide for <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/deploy-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to deploy a server<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"prerequisites\"><\/a>Upgrading the Magento applications and extensions can require up to 2GB of RAM to complete an upgrade successfully. For the best results, you should select a configuration with at least the recommended 2GB of system memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Running a Magento site requires a modern LAMP stack (Linux, Apache, MySQL\/MariaDB, PHP) or LEMP stack (Linux, Nginx, MySQL\/MariaDB, PHP). For this guide, we will use Apache2, MariaDB 10.6 (or MySQL 8.0), and PHP 8.1, which are compatible with Magento 2.4.6.<a id=\"apache2\" style=\"background-image: url('img\/anchor.gif');\"><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this section, you will find streamlined instructions for fulfilling each of these requirements by installing Apache2, MariaDB, and PHP.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Apache2<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Start by installing Apache2 from the default repositories with the following updated command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install apache2&nbsp;-y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then create a new configuration file for Magento Open Source by using the steps below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo a2enmod rewrite<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then create a new configuration file for the Magento Open Source site by opening a text editor with the next command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/etc\/apache2\/sites-available\/magento2.example.com.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the example configurations to the file, then save and exit the editor.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;VirtualHost *:80&gt;\n   ServerAdmin webmaster@localhost\n   DocumentRoot \/var\/www\/html\/magento2\/\n   ErrorLog \/var\/www\/html\/magento2\/error.log\n   CustomLog \/var\/www\/html\/magento2\/access.log combined\n   &lt;Directory \/var\/www\/html\/magento2\/&gt;\n      Options Indexes FollowSymLinks MultiViews\n      AllowOverride All\n   &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, disable the default site and enable your Magento configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo a2dissite 000-default.conf\nsudo a2ensite magento2.example.com.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create the following directory for the site.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkdir \/var\/www\/html\/magento2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart Apache.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><a id=\"mariadb\" style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; background-image: url('img\/anchor.gif');\"><\/a>sudo systemctl restart apache2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the first of the prerequisites installed, continue to the next step to install the database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">MariaDB<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">MariaDB is a popular open source alternative to the MySQL database server. It is available on Ubuntu default repositories, but for the latest&nbsp;version, you will need to add their own repo to your sources list with the commands below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MariaDB 10.6 is the recommended version as it&#8217;s compatible with Magento 2.4.x and supported by Ubuntu 22.04. To install MariaDB, follow these commands to add the MariaDB repository:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install software-properties-common\nsudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xF1656F24C74CD1D8\nsudo add-apt-repository 'deb http:\/\/mirrors.coreix.net\/mariadb\/repo\/10.2\/ubuntu xenial main'<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Note: If you prefer to use MySQL, you can install MySQL 8.0 instead, which is fully compatible with Magento 2.4.x.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have imported the key and added the repository, you need to update your sources and then install MariaDB. When installing the database, the installation script will ask you to set a password for the database, create a password for the root user when prompted.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update\nsudo apt install mariadb-server -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the database install is complete, you will need to configure MariaDB with a database for the Magento install.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Log into your database server using the root user and the password you set during the installation. Enter the following command to get to the MySQL command prompt.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u root -p<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the following commands in the order shown to create a database instance named <tt>magento2<\/tt> with username <tt>magento<\/tt>&nbsp;with the same for the&nbsp;password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CREATE DATABASE magento2;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GRANT ALL PRIVILEGES ON magento2.* TO &#8216;magento&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;YourSecurePassword&#8217;;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE DATABASE magento2; \nGRANT ALL PRIVILEGES ON magento2.* TO 'magento'@'localhost' IDENTIFIED BY 'YourSecurePassword'; \nFLUSH PRIVILEGES;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using the <tt>exit<\/tt> command will quit the database client and return to the regular terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the database was created successfully and that the new user is able to access it. Use the command below along with the password set to the user to log into the database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u magento -p<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Granted the database opened, exit the command prompt like before.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MariaDB [(none)]&gt; exit<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"php\" style=\"font-family: Consolas, Monaco, monospace; background-image: url('img\/anchor.gif');\"><\/a>In case you get any errors, repeat the preceding commands in the database command prompt on the root user and try again.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">PHP 7.0<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The last part of the LAMP stack is the hypertext preprocessor or PHP in this case. Magento also requires a number of additional PHP packages. Magento 2.4.x requires PHP 8.1 for compatibility and performance. Install PHP 8.1 along with the necessary modules using the updated command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install php7.0 php7.0-curl php7.0-mysql libapache2-mod-php7.0 \nphp7.0-bcmath php7.0-curl php7.0-gd php7.0-intl php7.0-mbstring&nbsp;php7.0-mcrypt \nphp7.0-soap php7.0-xml php7.0-xsl php7.0-zip php7.0-json php7.0-iconv -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once all of the PHP packages have been installed, you should make a couple of quick changes to the configuration files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the PHP configuration file for PHP 8.1 with the command below to adjust execution time and memory limits.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/etc\/php\/7.0\/cli\/php.ini<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the row that defines the <tt>max_execution_time<\/tt> and set the value to <tt>180<\/tt> like below, then save and exit the editor.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">max_execution_time = 180<br>memory_limit = 1024M<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the next command to open the other configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/etc\/php\/7.0\/apache2\/php.ini<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It will also contain a <tt>max_execution_time<\/tt> that should be set to a little higher value.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">max_execution_time = 180<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the same file, you will find a <tt>memory_limit<\/tt> that can be increased accordingly depending on your cloud server configuration. For example, on the basic 2GB preconfigured instance you should set the <tt>memory_limit<\/tt> to <tt>1024M<\/tt>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">memory_limit = 1024M<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Afterwards, save the changes and exit the editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"downloading-magento\" style=\"background-image: url('img\/anchor.gif');\"><\/a>With the PHP configured, your LAMP stack is then ready to host Magento Open Source. Continue below with the instructions to downloading and setting up your e-commerce site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Downloading Magento<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Magento is available for download in multiple versions and via a couple of channels. The open source version can be downloaded either manually from Magento\u2019s product files or from their GitHub repository. You also have the option to download the Magento source with ready-to-go sample data included to get an example site up and running in no time at all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Regardless of the method used to download Magento packages, you will need to <a href=\"https:\/\/account.magento.com\/customer\/account\/login\" target=\"_blank\" rel=\"noopener\">start by registering and logging into a Magento account.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have registered with Magento, start off the server side configurations by creating a new user for running Magento without root priveledges.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo adduser --disabled-password --gecos \"\" magento\n<a id=\"access-token\" style=\"background-image: url('img\/anchor.gif');\"><\/a>sudo adduser magento www-data<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then choose the option for downloading Magento you wish to use and continue below.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option 1. Manually with Access Token<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Log into your Magento account and go to the <a href=\"https:\/\/account.magento.com\/downloads\/token\/\" target=\"_blank\" rel=\"noopener\">Download Access Token<\/a> under Account Settings menu. There you will find your Magento ID and the access token options which can be used to download Magento packages on the command line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click the link to <em>Generate new token<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then use the following command to check the available Magento downloads while replacing the <tt>&lt;ID&gt;<\/tt> and <tt>&lt;TOKEN&gt;<\/tt> with your credentials.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -k https:\/\/&lt;ID&gt;:&lt;TOKEN&gt;@www.magentocommerce.com\/products\/downloads\/info\/filter\/version\/2.*<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can download any specific file using the correct path and filename, for example <tt>...\/downloads\/file\/Magento-CE-2.1.9.tar.gz<\/tt> for that version without sample data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Download the package version you wish, e.g. with the sample data using the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -k -O https:\/\/&lt;ID&gt;:&lt;TOKEN&gt;@www.magentocommerce.com\/products\/downloads\/file\/Magento-CE-2.1.9%2BSamples.tar.gz<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the download finishes, create a directory for the files and extract the package.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir ~\/magento2\ntar zxvf ~\/Magento-CE-2.1.9%2BSamples.tar.gz -C ~\/magento2\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then copy the files to the web server directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><a id=\"composer-github\" style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; background-image: url('img\/anchor.gif');\"><\/a>sudo cp -R ~\/magento2 \/var\/www\/html\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the Magento downloaded and copied over, jump forward to the <a href=\"#configuring-magento\">next section<\/a> to continue configuring the site.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option 2. Using Composer and GitHub<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Magento 2.4.x relies heavily on Composer for dependency management. Ensure you have Composer version 2.0 or later installed, as Magento 2.4.x requires it. You can install Composer with the command below:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Download and install Composer with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -sS https:\/\/getcomposer.org\/installer | php\nsudo mv composer.phar \/usr\/local\/bin\/composer<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will also need to create a folder for Composer in the Magento user\u2019s home directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkdir \/home\/magento\/.composer<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, log into your GitHub account and create a new Access token. <a href=\"https:\/\/help.github.com\/articles\/creating-a-personal-access-token-for-the-command-line\/\" target=\"_blank\" rel=\"noopener\">You can find instructions for how to do this at the GitHub help article.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Leave the page open with your access token for the moment and log into your Magento account. <a href=\"https:\/\/marketplace.magento.com\/customer\/accessKeys\/\" target=\"_blank\" rel=\"noopener\">Open the Marketplace tab and click Access Keys section.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the Access Keys page, click the button to <em>Create a New Access Key<\/em>, give the key pair a name and then click <em>OK<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento developer documentation has additional <a href=\"http:\/\/devdocs.magento.com\/guides\/v2.0\/install-gde\/prereq\/connect-auth.html\" target=\"_blank\" rel=\"noopener\">instructions for using your Access Keys<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have generated both your GitHub access token and Magento access keys, create a new file in the Composer directory called <tt>auth.json<\/tt>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/home\/magento\/.composer\/auth.json<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the following information while replacing the <tt>&lt;github-token&gt;<\/tt> with the access token to your GitHub account and the Magento public and private keys respectively.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n&nbsp; &nbsp;\"github-oauth\": {\n&nbsp; &nbsp; &nbsp; \"github.com\": \"&lt;github-token&gt;\"\n&nbsp; &nbsp;},\n   \"http-basic\": {\n      \"repo.magento.com\": {\n         \"username\": \"&lt;magento-public-key&gt;\",\n         \"password\": \"&lt;magento-private-key&gt;\"\n      }\n   }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and exit the editor, then fix the file ownership of the <tt>.composer<\/tt> directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chown magento:magento -R&nbsp;\/home\/magento\/.composer<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You are then ready to clone the repository, change into the HTML root directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/www\/html<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that you have <tt>git<\/tt> installed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install git<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then clone the repository with the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo git clone https:\/\/github.com\/magento\/magento2.git<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Update the directory ownership.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chown www-data:www-data -R \/var\/www\/html\/magento2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, switch to the <tt>magento<\/tt> user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo su magento<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change into the Magento site directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/www\/html\/magento2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then use Composer to install the site.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><a id=\"configuring-magento\" style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; background-image: url('img\/anchor.gif');\"><\/a>composer install<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once completed, continue to the last part of this guide to finalize the Magento installation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring the Magento install<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The final part of installing Magento Open Source is to configure the site admin and a few other available options. This can be performed either on command line or following the install wizard in a web browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, ensure the correct ownership and permissions are set for the Magento installation directory for compatibility with Ubuntu 22.04 and newer versions of Magento.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/var\/www\/html\/magento2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the web server has the ownership over the files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chown -R www-data:www-data .<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then set the following permissions per each file and folder.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo find . -type d -exec chmod 775 {} ;\nsudo find . -type f -exec chmod 664 {} ;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These permission updates might take a moment to process because of the number of files and folders, especially with sample data included.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, add the indexing cron jobs shown underneath to the <tt>magento<\/tt>&nbsp;user\u2019s crontab. Open the crontab in an editor with the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo crontab -u magento -e<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Choose the editor you wish to use, then copy the following lines to the file, save and exit.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">* * * * * \/usr\/bin\/php \/var\/www\/html\/magento2\/bin\/magento cron:run | grep -v 'Ran jobs by schedule' &gt;&gt; \/var\/www\/html\/magento2\/var\/log\/magento.cron.log\n* * * * * \/usr\/bin\/php \/var\/www\/html\/magento2\/update\/cron.php &gt;&gt; \/var\/www\/html\/magento2\/var\/log\/update.cron.log\n* * * * * \/usr\/bin\/php \/var\/www\/html\/magento2\/bin\/magento setup:cron:run &gt;&gt; \/var\/www\/html\/magento2\/var\/log\/setup.cron.log<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, restart Apache to apply all the changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart apache2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"browser-configurations\" style=\"background-image: url('img\/anchor.gif');\"><\/a>As mentioned above, you have two options for&nbsp;finalizing the Magento Open Source installation; <a href=\"#browser-configurations\">in web browser guided wizard<\/a> or <a href=\"#command-line-configurations\">a command line configuration tool<\/a>. Continue below with the method you prefer.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option 1. In browser configurations<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once all of these are set, you can continue in your web browser by opening your cloud server\u2019s public IP or domain.&nbsp;You can find your server\u2019s IP addresses in your <a href=\"https:\/\/hub.upcloud.com\/networks\/public\" target=\"_blank\" rel=\"noopener\">UpCloud control panel<\/a> under Network menu.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/&lt;public IP&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the instructions presented in the installation wizard to set up the site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1.<\/strong> Start by running the readiness checks, the results should show all green.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/1-readiness_check2.png\" alt=\"Readiness check\" class=\"wp-image-6196\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2.<\/strong> Enter the database details as configured earlier while installing MariaDB.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/2-database.png\" alt=\"Database\" class=\"wp-image-6197\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3.<\/strong> Check your site configurations and updated as necessary. You can set the store to use a domain if you have one configured for the server. And while the admin default URL is just fine, you might wish to change it to something easier to remember.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/3-web_configuration.png\" alt=\"Web configuration\" class=\"wp-image-6198\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4.<\/strong> Customize your store with the available time zone, currency and language options or continue along with the defaults.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/4-customize-your-store.png\" alt=\"Customise your store\" class=\"wp-image-6199\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.<\/strong> Enter user details for your admin account.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/5-admin_account.png\" alt=\"Admin account\" class=\"wp-image-6200\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6.<\/strong> When you are done with the options, click the <em>Install Now<\/em> button to let the system do its thing. This might take a moment.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/6-start_install.png\" alt=\"Start install\" class=\"wp-image-6201\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Success!<\/strong> Once finished, you will be presented with a summary of your site configurations. The&nbsp;page includes your website and admin URLs which you might want to bookmark for later.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/7-install_success.png\" alt=\"Install success\" class=\"wp-image-6202\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"command-line-configurations\"><\/a>After successfully installing Magento Open Source, disable write access to the following directory with the command below for security purposes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod -w \/var\/www\/html\/magento\/app\/etc<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Option 2. Command line configurations<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can make the last configurations also on the command line with the help of the <tt>magento<\/tt> tool in the <tt>...\/magento2\/bin\/<\/tt> directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, make the file is executable with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod +x \/var\/www\/html\/magento2\/bin\/magento<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can check the available configuration options over at Magento&nbsp;<a href=\"http:\/\/devdocs.magento.com\/guides\/v2.0\/install-gde\/install\/cli\/install-cli-install.html\" target=\"_blank\" rel=\"noopener\">developer documentation for command line install<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following example command includes the minimum parameters to get the site installed. Replace the <tt>&lt;public IP&gt;<\/tt> with your server\u2019s public IP address or domain name if you have one. You can find your server\u2019s IP addresses in your <a href=\"https:\/\/hub.upcloud.com\/networks\/public\" target=\"_blank\" rel=\"noopener\">UpCloud control panel<\/a> under Network menu.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/var\/www\/html\/magento2\/bin\/magento setup:install --admin-firstname=\"admin\"&nbsp;--admin-lastname=\"admin\"&nbsp;--admin-email=\"admin@example.com\"&nbsp;--admin-user=\"magento\"&nbsp;--admin-password=\"magento2\" --db-user=\"magento\" --db-password=\"magento\" --base-url=\"http:\/\/&lt;public IP&gt;\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The installation will take a moment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once completed, you will see an output similar to the one below confirming the installation and showing your admin URL.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[SUCCESS]: Magento installation complete.\n[SUCCESS]: Magento Admin URI: \/admin_148ohr<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For security, remove write permissions from the following directory with the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod -w \/var\/www\/html\/magento2\/app\/etc<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart Apache and your site will be available for testing.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart apache2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a id=\"summary\" style=\"background-image: url('img\/anchor.gif');\"><\/a>If you have problems opening the site, rerun the following command to make sure the web server has access rights to the whole <em>\/magento2<\/em> directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chown -R www-data:www-data&nbsp;\/var\/www\/html\/magento2<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You should now have a fully functional&nbsp;Magento Open Source e-commerce site up and running.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento boasts the largest and most active community of developers and merchants in the world. Developers share innovative ideas, help each other, and collaborate to improve the capabilities and performance of the Magento Open Source platform. With the help of the <a href=\"https:\/\/magento.com\/resources\/technical\" target=\"_blank\" rel=\"noopener\">comprehensive documentation<\/a> available for Magento, you can easily join the community to begin designing your own commerce extensions or build the next hit marketplace.<\/p>\n","protected":false},"author":3,"featured_media":27338,"comment_status":"open","ping_status":"closed","template":"","community-category":[223],"class_list":["post-2284","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=2284"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/2284\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=2284"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=2284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}