Article

One-Click Magento

Last Updated: Tue, Jun 30, 2020
Business One-Click Apps

Introduction

Vultr's One-Click Magento application is a ready-to-run eCommerce platform running Magento Community Edition on Ubuntu server. Select a server location, choose your instance size, and click Deploy Now. Your server will be ready to configure in about a minute. Magento requires a Vultr instance with at least 1 GB of RAM. Magento runs on the Ubuntu Server LTS operating system.

To follow this installation guide, locate two sets of user credentials on the Server Information screen. The root login (1), is used for console access. The Admin user (2) is used for web administration. Substitute the server's domain name or IP address anywhere oneclick.example.com appears in this installation guide.

Application Info

1. Install SSL Certificate

This step is optional, but recommended. Most Magento administrators will use a domain name and valid SSL certificate for their site. If you plan to use a commercial SSL certificate, see the Commercial SSL section.

If you skip this step:

  • Substitute the server IP address for oneclick.example.com.
  • You will encounter a certificate security warning.
  • Proceed past the warning to complete setup.

To install a free Let's Encrypt SSL certificate:

  1. Register the name and create a DNS record for the server's IP address. Consult your DNS provider for instructions, or see our guide if using Vultr's DNS.
  2. Verify the DNS has finished propagation and the name is visible throughout the internet before proceeding. Propagation usually happens quickly, but could take up to 48 hours in some cases.
  3. Connect to your server, with the root login (1) from the Server Information screen.
  4. Install certbot and the Nginx plugin to manage the Let's Encrypt certificate.

    # apt install python-certbot-nginx -y
    
  5. Set the server_name for Nginx. Edit /etc/nginx/conf.d/magento_https.conf:

    # nano /etc/nginx/conf.d/magento_https.conf
    

    Change the underscore in the line "server_name _;" to your server domain name. This appears near the top of the file. For example:

    server {
        listen 443 ssl default_server;
        server_name oneclick.example.com;
    

    Save and exit the file.

  6. Install the certificate with certbot. Replace the domain name and email with your values.

    # certbot --nginx --redirect --agree-tos --no-eff-email -d oneclick.example.com -m admin@example.com 
    

    Certbot should report success when finished.

2. Configure Magento Base URL

When first installed, Magento uses the IP address as the base URL. This step changes the base URL to the domain name. You will encounter a certificate warning for your first admin login because Magento redirects your browser to the IP address.

  1. Navigate to the admin area of your store. For example:

    https://192.0.2.123/admin_123456
    
  2. Proceed past the certificate warning.

  3. Log in to Magento with the Admin user (2).
  4. Navigate to Stores > Configuration.

    Store Configuration

  5. Navigate to Web > Base URLs. Make two changes:

    • Change the Base URL to your server domain name.
    • Change the Base URLs (Secure) to your server domain name.

    Base URL

  6. Click Save Config. Magento will log you out and redirect you to log in again, this time at the server domain name.

  7. Magento will display a warning that the cache needs to be flushed. Follow the link and clear Magento's cache.
  8. Verify that the certificate in your browser is valid.

More Information

MySQL

A MySQL database is running on your VPS for Magento. If you need to access the database directly:

  1. Connect to the server via ssh as root.
  2. Log into MySQL.

    # mysql -u root
    

    The MySQL root password is saved in /root/.my.cnf.

XHProf Performance Analysis

Access your XHProf installation at https://oneclick.example.com/xhprof/xhprof_html/. You'll find the username and password on your Server Information page.

PHPMyAdmin Database Manager

Access your PHPMyAdmin installation at https://oneclick.example.com/mysqladmin/. You'll find the username and password on your Server Information page.

Cockpit Control Panel

Access your Cockpit a control panel at https://oneclick.example.com:9080. You'll find the username and password on your Server Information page.

Disable Cockpit

If you need to disable Cockpit, SSH to the server as root and run the following command:

# systemctl disable --now cockpit.socket

Vultr Helper Scripts

Vultr provides helper scripts for common issues. SSH to the server as root to run these scripts.

Reset Nginx

If Nginx fails to load, you may have a typo or corruption in your configuration files. The fix-vhost.sh script will reset the Nginx configuration to default.

# /opt/vultr/fix-vhost.sh
All vhosts have been restored to their default state!

Check Software Versions

For debugging purposes, our support team may ask for your Magento and Ubuntu versions. Run the version.sh script.

# /opt/vultr/version.sh 
OS: '18.04.4 LTS (Bionic Beaver)'
Magento: '2.3.5-p1'

Commercial SSL

You can use a Commercial SSL certificate instead of the free Let's Encrypt certificate.

How to install a commercial SSL certificate

  1. Obtain a certificate from a certificate authority for your domain.
  2. Replace the server.crt and server.key files in /etc/nginx/ssl/ with the commercial certificate. Refer to your certificate vendor's documentation for details.
  3. Reboot the server.

    # reboot
    

Certbot considerations

Certbot makes changes to the Nginx configuration. If you used certbot to obtain a Let's Encrypt certificate, return the Nginx configuration files to default before installing the commercial certificate.

  1. Back up your existing Nginx configuration files

    # cp -r /etc/nginx/ /root/nginx
    
  2. Revoke your certbot certificate.

    # certbot delete
    
  3. Restore the default Nginx configuration.

    # /opt/vultr/fix-vhost.sh
    

Directories of Interest

Magento is installed at: /var/www/html

Update Bug

This issue was corrected in February 2016.

Magento 2.1.3 failed to include a link to the updater in the admin panel. You can navigate to the updater manually with the following link. Replace the parts in caps accordingly.

https://[SERVER_IP]/[admin_SECRETURL]/admin/backendapp/redirect/app/setup/

About One-Click Apps

One-Click apps are updated regularly without notice. When launching a One-Click app, you'll receive our latest version. We do not update deployed instances, and you are responsible for keeping the instance up-do-date. If you design an infrastructure based on One-Click apps and need to ensure the same app version in the future, take a snapshot of the initial deployment and create new instances from the snapshot.

Want to contribute?

You could earn up to $300 by adding new articles