Blog

  • Containerized Core – A Seemingly Small (Yet Important) Improvement To Server Management

    Containerized Core – A Seemingly Small (Yet Important) Improvement To Server Management

    Docker is a technology that allows you to run applications in isolated environments called containers.

    Containers are lightweight, portable, and scalable, making them ideal for cloud-native development and deployment.

    Did you know that containerization saw a massive leap in adoption in 2022, with over 31% of developers worldwide stating that they are running container technologies?

    RunCloud Docker is a server that leverages the popular Docker technology to isolate most of your application dependencies such as Redis, MariaDB, NGINX, PHP, and beyond from the operating system level.

    This makes your applications more secure and easier to manage.

    But beyond that, this is a big under-the-hood improvement that stands to allow us to continue leveling up on how you manage your servers with RunCloud.

    RunCloud provides a simple interface to start and stop these predefined containers. Your web applications are further protected by facl, a UNIX interface to manage access, which prevents them from accessing each other’s files and folders.

    Containerized Core is now out of beta and in early access.

    This means it’s safe to use in production (while there may still be rare edge-case scenarios as it rolls out across the board).

    It’s no longer necessary to be a Linux expert anymore to be able to enjoy the flexibility and security of containerized applications.

    Before we proceed, it is important to note that Docker server runs on a containerized environment without a built-in firewall. To secure your server, you need to configure the firewall provided by your cloud provider. If you use DigitalOcean, Linode, Vultr, or AWS Lightsail, RunCloud makes it easy for you to do that from the dashboard itself.

    If you attempt to configure firewall on a containerized container, you will get the error message shown in the above screenshot.

    How To Use Docker On RunCloud

    RunCloud allows you to easily manage and deploy your web applications on any cloud provider that provides a network firewall using Docker.

    To use Docker on RunCloud, you need to create a new server and select the Docker option during the setup installation.

    You cannot use Docker on existing servers that are already managed by RunCloud. This is because RunCloud needs to install some packages and configurations that are specific to Docker and may conflict with your existing setup.

    Here are the steps needed to create a new server with Docker on RunCloud:

    1. Log in to your RunCloud account and click on the “Connect a Server” button.
    2. Choose your cloud provider and select the provision method. We recommend using RunCloud’s automatic provisioning feature for a painless installation.
    3. In the “Installation Type” section, select the Docker option. Currently, this method only supports Nginx servers.
    Installing docker server
    1. The next steps will differ slightly depending on your installation method. If you picked the automatic installation, you can select your server configuration and deploy it directly from within the RunCloud dashboard.

      If you selected the manual installation, you’ll need to log in to your virtual machine via SSH and run the installation script.

      Either way, it’s a straightforward process; refer to our blog post about the installation process for more information.
    2. Once your server is ready, you can access it from the RunCloud dashboard and start using Docker.

    How Docker Enhances Security

    Docker provides better security for your application by isolating it from the host operating system and other applications on the same server. Docker containers have their own file system, network stack, and process space, which limits the access and impact of a potential attacker.

    Docker also supports various security features that can restrict the capabilities and resources of a container.

    For example, if you run a WordPress site in a Docker container and it gets hacked by a malicious actor, the hacker will not be able to interact with the host operating system or other containers on the same server. The hacker will be trapped in the container, and will only have access to the files and processes within it.

    In this way, you can protect your server and other applications from being compromised or damaged by a security breach.

    How to Upgrade to RunCloud Docker

    As we mentioned earlier, if you are using the native variant of RunCloud and want to upgrade to RunCloud Docker, you’ll need to create a new server with Docker, and clone your existing applications from your old server to your new server.

    If you don’t have a server with Docker installed, go back to the How To Use Docker On RunCloud section.   

    Here are the steps to upgrade from the native servers to RunCloud Docker:

    1. Once your new server is ready, you can clone your existing applications from your old server to your new server. To do this, go to the Applications tab on your old server and click on the “Cloning” button. You need to do this individually for each application that you want to clone.

    In the above example, the server using Nginx was named “nginx” and the server using Docker was named “docker” for demonstration purposes. These names will vary depending upon your setup.

    1. Choose your new server as the destination, and enter a name for the cloned application. You can also choose whether to clone the database and the files of the application. If you are cloning a web application that relies on a database (e.g. WordPress), you must select this option.

    Select the database that you want to clone from the drop down menu. The name of the database is generally similar to the name of the application. After this, provide a new name for your database and web application – this will be displayed in the RunCloud dashboard under your new server.

    1. After this, you need to select the user account on your server that will be the owner of your web application. You can either pick one of the existing users, or create a new user.
    1. Finally, you need to configure the domain name of your application. We recommend using a test domain during migration. This will allow you to access your containerized application and, in the meantime, all the existing traffic will continue to go to your old servers. Once you are satisfied, you can update your test domain. 
    2. Click on the Clone Application button and wait for RunCloud to clone your application to your new server. Repeat the above steps for each application you want to clone from your old server to your new server.
    3. Once you have cloned all your applications, you’ll need to update the DNS records of your domains to point to your new server. To do this, you can either use RunCloud’s Cloudflare integration, or go to your domain registrar or DNS provider and change the A records or CNAME records of your domains to point to the IP address of your new server.
    4. Wait for the DNS changes to propagate, and verify that your applications are working properly on your new server. If you are planning this ahead of time, you should also read our guide on How To Speed Up DNS Propagation.

    You have successfully upgraded from the native variant to Containerized Core.

    You can now enjoy the benefits of using Docker containers on your new server. You can also log in to your server via SSH to access your new server, and manage your containers via Docker CLI.

    Conclusion

    Docker is an incredibly powerful tool for creating and running applications in containers. With this improvement to RunCloud’s core powered by containerization – we’re beyond excited for you all to take advantage of the benefits of containerization as well as what this means for the future of managing your infrastructure on RunCloud.

    The RunCloud team is committed to delivering the best possible experience to our users across the board. We welcome your feedback and suggestions on how to make it better for you. Please feel free to reach out to us, or join our community forum to share your thoughts and experiences.

    You don’t need to be a Linux expert anymore to enjoy the benefits of Docker. With RunCloud, you can create and run isolated web applications with just a few clicks.

    Sign up today and see for yourself how easy and convenient it is to use Docker on RunCloud.

  • How to Set Up an Amazon Lightsail Server with RunCloud

    How to Set Up an Amazon Lightsail Server with RunCloud

    Amazon Lightsail is an easy-to-use cloud service from Amazon Web Services (AWS) that offers you everything needed to build an application or website, and comes with predictable pricing.

    It’s one of the top choices to host your website. If you want to host your site using the AWS infrastructure without having to deal with the complexity of Amazon Elastic Cloud Compute (Adobe EC2), then Amazon Lightsail is the answer for you.

    Amazon Lightsail has a very simple pricing plan, which makes it a direct competitor to Digital Ocean, Linode, Vultr, and UpCloud – with a similar pricing range and included resources.

    Amazon has many data centers spread across different regions, including:

    1. Ohio
    2. Virginia
    3. Montreal
    4. Oregon
    5. Ireland
    6. London
    7. Paris
    8. Frankfurt
    9. Tokyo
    10. Sydney
    11. Seoul
    12. Mumbai
    13. Singapore.

    This gives you the flexibility to either choose a server location that is geographically close to your customers, or a server that’s in a remote location and which is cheaper to run.

    In this post, we will discuss how to set up an Amazon Lightsail server to host your websites with the help of RunCloud.

    Let’s get started!

    Why Use RunCloud?

    You don’t need to be a Linux expert to build and manage a website with RunCloud. Here are some of major reasons people use RunCloud:

    If you don’t have a RunCloud account, You can register for a 7-day free trial – no credit required.

    Connecting Amazon Lightsail Server via RunCloud Integration

    With our server provisioning feature, you can set up a server in Amazon Lightsail directly from the RunCloud dashboard by providing an API key from Amazon Lightsail to RunCloud.

    You’ll only need to leave the RunCloud dashboard once to get this key and add it to RunCloud 3rd Party API Key Settings.

    Within the RunCloud dashboard, for any future server creations, you’ll be able to add new servers without having to leave your dashboard.

    Creating an Amazon Lightsail API Key

    To use RunCloud with Amazon, you’ll need to integrate AWS by adding the necessary API keys to your account. You can generate these keys from your AWS dashboard.

    We strongly recommend you don’t use the root account to create your API keys. It’s a good idea to create a separate user account just for RunCloud, and limit its access to your infrastructure.

    Log into your AWS Console with a user account and open the security credentials page. You can either search for it in the search bar on the top, or use this link which will redirect you to the necessary page. Once there, scroll down to the “Access Keys” section.

    Click on the “Create access key” button to generate your keys. On the next screen, select “Application running outside AWS” and proceed.

    Give your API key a descriptive name so that it is easy to identify later on and click “Create”.

    Once you create your keys, they will only be displayed once – do not close this tab. Open the RunCloud dashboard in a new browser window to continue the integration process.

    To ensure RunCloud can fully connect to and manage your AWS Lightsail server, the AWS IAM user associated with the credentials you provide must have the necessary permissions. A missing permission can prevent specific RunCloud features from working correctly. To manage your server via the RunCloud dashboard, please make sure the IAM policy grants the following permissions on all Lightsail resources (*).

    "lightsail:GetOperations",
    "lightsail:GetBlueprints",
    "lightsail:GetInstances",
    "lightsail:GetKeyPair",
    "lightsail:DeleteKeyPair",
    "lightsail:CreateInstances",
    "lightsail:GetInstance",
    "lightsail:DeleteInstance",
    "lightsail:CreateKeyPair",
    "lightsail:ImportKeyPair",
    "lightsail:PutInstancePublicPorts",
    "lightsail:GetInstancePortStates",
    "lightsail:AttachStaticIp",
    "lightsail:GetRegions",
    "lightsail:GetOperation",
    "lightsail:GetBundles",
    "lightsail:GetKeyPairs",
    "lightsail:AllocateStaticIp"

    Adding the Amazon API Key to RunCloud

    Once you have created the API keys, you shouldn’t store them anywhere on your computer. You won’t need them again after you have added them to your RunCloud account and the integration is complete.

    To add an API key, go to your RunCloud dashboard. Open the Account Settings and switch to the Integrations tab. Once there, click on “AWS Lightsail” and then “Add Integration”.

    Now, you will be presented with the following screen. Give a descriptive label to your API key, if you have more than one AWS account, this label will be helpful to distinguish between them.

    Once you’ve done that, copy and paste the “Access Key ID” as well as the “Secret Access Key” that we just generated in the creating an API key step.

    After adding the key, you can test the integration using the “Test” button. If you get a success message, you can click “Save Integration” to save the changes. Once your key is integrated, you can close the AWS tab as well.

    Deploying Amazon Lightsail Server on RunCloud

    To get started, click on the “Connect a Server” button to set up your first server.

    A screen will pop up showing you a list of available server providers. Select Amazon Lightsail from the list, and then click the “Deploy Server Automatically” provision type to use RunCloud’s automatic integration.

    Now, scroll down to the bottom half of the page and select the installation type as well as your desired server infrastructure. Then select the API key from the dropdown, and click “Continue”.

    Note: At the time of writing, RunCloud users will not be able to connect servers running Ubuntu 24 using AWS Lightsail to their RunCloud dashboard.

    On the next screen, you will need to specify the operating system, datacenter region and the instance type of your server. Just click on the choice you want, and it will be highlighted.

    Now scroll down to the bottom of the page, where you will be asked to provide a name for your server. Give it a suitable name, and check the box to acknowledge that you understand you will be billed for this server. Then click “Add Server”.

    After adding the server, RunCloud will take a few minutes to install the necessary software and dependencies on your server. You don’t need to do anything at this point, just sit back and wait for the installation to finish.

    Once finished, you will be redirected to the following screen:

    Tips – Create a Static IP Address For Amazon Lightsail

    When creating an Amazon Lightsail instance, you will get a private IP and public IP for each server. You can use the public IP to connect to your instance from the Internet, including setting up your server using RunCloud.

    Unfortunately, it’s not a static IP address. This means that this public IP will be changed automatically when you stop and restart your Amazon Lightsail server.

    If you use Amazon Lightsail to host your website, it’s highly recommended that you use the static IP address for your server. This static IP is dedicated to you, and will not be changed when you stop and restart your server. However, you will be charged $0.005 USD/hour fee for static IPs not attached to an instance.

    To reserve a static IP, go to your AWS console and open the AWS Lightsail dashboard. Once there, locate the server that you just created via RunCloud.

    Go to the Networking tab and click on “Attach static IP” to reserve a static IP address. Follow the instructions to create a new IP address, and save it.

    Amazon Lightsail

    After you have added the new IP address to your AWS Lightsail server, it might change from the one you have previously. If your new IP address is different from your current IP address, you will need to configure RunCloud to use this new address.

    Go to your RunCloud dashboard and click on your server. It should give you a message saying “Server information is not available”. If not, just wait for a few minutes and refresh the page. Once RunCloud is no longer able to connect your server, it will ask you to troubleshoot the issue.

    Click on the “Update IP address” button to add a new IP address. A prompt will appear asking you to enter the new address. Add the new IP address, and click “Save”.

    Next, you will need to run a script in your AWS server. Go to your AWS Lightsail dashboard and click on “Connect using SSH”. This will open an SSH connection in a new browser window. Copy and paste the script from RunCloud into this window and press “Enter”.

    Please check the video below to learn how to set up a static IP address for your Amazon Lightsail server:

    Now that RunCloud should be able to connect to your server again, refresh your dashboard. If everything is still working as expected, then you can close the SSH session.

    Managing Firewall Rules for Your Lightsail Server

    When you provision a new Amazon Lightsail server directly through the RunCloud dashboard, RunCloud streamlines the setup process by automatically creating the necessary firewall rules. These initial rules are designed to secure your server while allowing essential services to function, such as traffic for SSH (port 22), HTTP (port 80), HTTPS (port 443), and the RunCloud agent communication.

    However, if your application has specific requirements, or you need to open additional ports, you can modify these rules at your own risk.

    To do so, you’ll need to leave the RunCloud dashboard and manage the settings directly within your AWS Lightsail account. Navigate to your Lightsail dashboard, select the server instance you wish to configure, and click on the “Networking” tab. Within this section, you will find the firewall configuration area where you can create new rules or edit existing ones.

    While editing the rules, you should remember that Lightsail requires you to create separate rules for both IPv4 and IPv6 traffic. For any custom rule you add, you must create an identical version for each protocol if you want the rule to apply universally.

    For example, if you want to enable the performance benefits of HTTP/3 on your server, you must create a new firewall rule to allow incoming UDP traffic on port 443 for your server’s IPv4 address. To copy this rule to IPv6, you can just select the checkbox next to “Duplicate rule for IPv6”, and AWS will automatically create another rule for you.

    After clicking “Create“, the new firewall rules will be applied to your server immediately.

    After Action Report

    Amazon Lightsail is the easiest way to get started with the Amazon Web Service infrastructure for developers who need a simple virtual private server (VPS) solution with predictable pricing, starting from $3.50 / month.

    RunCloud’s integration for AWS makes it easy to manage servers across multiple AWS accounts. After setting up your server, you can learn How To Install WordPress With RunCloud using our step-by-step guide.

    RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. Experience a painless server configuration so you don’t need to spend hours figuring it out.

    Get started with RunCloud today & get up and running in minutes.

  • How To Monitor Your Web App’s RAM & CPU Usage with Netdata

    How To Monitor Your Web App’s RAM & CPU Usage with Netdata

    Netdata is a powerful tool that can help you monitor your servers with ease and efficiency. It’s a distributed, real-time, performance, and health monitoring platform that can collect and display thousands of metrics from your servers, hardware, containers, and applications, including RAM and CPU usage.

    Netdata has many features and benefits that make it a great choice for server monitoring, such as:

    • Real-time data collection and visualization: Netdata collects metrics every second, and displays them on interactive charts that update every second as well. This means you can see exactly what’s happening on your servers without any delays.
    • Infinite scalability: Netdata can scale to any number of servers and metrics without compromising performance or accuracy. It stores the data locally on each server, which means it doesn’t need a central database or a query engine. You can also use Netdata Cloud to view metrics from multiple servers in one dashboard, with secure streaming and encryption.
    • Flexible and modular architecture: Netdata can monitor any system, service, or application that exposes metrics with the help of its modular architecture and hundreds of integrations. You can also extend Netdata with custom collectors, plugins, dashboards, alarms, notifications, and more. Netdata is open-source and community-driven, so you can always find new features and improvements.
    • Zero configuration: Netdata is designed to work out of the box, without any need for configuration. It can auto-detect metrics from your servers and applications, and display them on preconfigured dashboards with meaningful visualizations and health alarms.

    Netdata is compatible with RunCloud, so you can use it alongside our platform to manage your web applications.

    How to Install Netdata on RunCloud Servers

    If you want to install Netdata on your RunCloud server, you can follow these simple steps:

    1. Sign up for Netdata: To use Netdata Cloud, you’ll need to sign up for a free account on their website. Netdata Cloud will allow you to view metrics from multiple servers in one dashboard, and access other features such as Metric Correlations and War Rooms.
    2. SSH into your RunCloud server: To install Netdata on your server, you’ll need to access it via SSH. If you don’t know how to do this, you can read our post on how to connect to your RunCloud server using SSH. You will need your server’s IP address, username, and password or SSH key.
    3. Open Installation Script: Once you have logged into your server via SSH, go to the Netdata dashboard and go to the “All Nodes” tab. Once there, click on “+ Add Node” button to view the installation script.
    Netdata dashboard view existing nodes.
    1. Execute the given command: You can install Netdata on your server with a single kickstart command. Change the update channel to “Stable“, and then copy the given installation command.
    Netdata Installation script.

    Upon execution, the above command will download and run a script that will install Netdata and its dependencies on your server. Go back to your SSH terminal, paste the given command, and then press ‘Enter’.

    Executing Netdata installation script on RunCloud

    During installation, it will ask you some questions about automatic updates, release channels, anonymous statistics, and Netdata Cloud connection. Press ‘Y’ to confirm the installation and then press ‘Enter’.

    After this, the installation daemon will ask you which services should be restarted. You can use the arrow keys to navigate up/down and press the spacebar to select/deselect options if you want to do so.

    Restarting services via CLI after installation

    In most cases, default selection is right choice for most people. Press the ‘Tab’ key on your keyboard – this will move cursor to the next position. Make sure that the ‘Ok’ is highlighted, and then press ‘Enter‘ to continue the installation.

    You will be asked to confirm the installation once again, press ‘Y’ to confirm, and then press ‘Enter‘.

    Daemon using outdated libraries on RunCloud.

    After this, the installation script will once again ask you which services should be restarted – leave these settings to default. Press ‘Tab‘ to highlight the ‘Ok’ button, and press ‘Enter‘ to finish the installation.

    Netdata installation completed successfully.

    That’s it! You have successfully installed Netdata on your RunCloud server. You can now access the Netdata web interface by visiting your Netdata dashboard.

    How to View Server Metrics

    To see the RAM and CPU usage of different servers, you can use either Netdata’s web interface or Netdata Cloud. Both options will show you interactive charts that update every second with real-time metrics.

    Using Netdata’s Web Interface

    Netdata hosts a dashboard on your server, which you can view by visiting port 19999 of your server. You can change this port by editing the Netdata configuration file. By default, RunCloud blocks all non-standard ports. Therefore, you’ll need to either connect to your server via a VPN, or open up the ports to visit the dashboard.

    To open up ports, go to your RunCloud dashboard and open the “Security” tab of the server. Click on “Add New Rule” and create a new rule to open up the specified ports on TCP and UDP. Once you have created all of the rules, you’ll need to click “Deploy” to save the changes.

    Open Firewall ports RunCloud

    Once you have opened up the firewall, anyone on the internet can view your Netdata Dashboard by visiting http://<ip address>:19999.

    Note: this will allow you to view the dashboard only for this particular server – if you have more than one server, you must repeat this step for all of them.

    This option presents a simplified user interface that displays all metrics of the selected server. This is useful if you don’t want to log into your Netdata Cloud account to view the metrics. However, you won’t be able to make any changes in this dashboard; for that, you will still need to log into your account.

    Netdata Local Dashboard depicting CPU, RAM, and Disk usage

    Using Netdata Cloud Dashboard

    Once you have connected a node to your cloud account, you can see it in your dashboard. One cloud account can connect to many servers, so you’ll need to navigate the dashboard and search for the server that you want to view.

    To view all available nodes connected to your account, navigate to the “All Nodes” page, and switch to the “Nodes” tab to view all connected nodes.

    Connected nodes on Netdata cloud dashboard

    In the above screenshot, we can see two nodes are connected to our Netdata account. The first node is inactive, and the second node is posting metrics to the cloud. You can click on this node to view detailed metrics.

    Netdata dashboard showing system metrics on RunCloud

    The above screenshot shows the overview of the system metrics. To view detailed metrics such as disk, memory, CPU usage, etc. for a particular application, click on the “Applications” button in the tab on the right of the screen.

    Netdata application monitoring metrics.

    Besides monitoring, you can also use this dashboard to invite new users and collaborate with them. 

    Final Thoughts

    Netdata is a powerful and easy-to-use tool that provides real-time insights into your server’s performance and health. You can use Netdata to visualize and analyze various metrics such as memory usage, CPU load, disk I/O, network traffic, and more. You can also set up alerts and notifications to get notified when something goes wrong with your web app.

    By using Netdata on RunCloud, you can benefit from the seamless integration and compatibility between the two platforms. If you have any questions or feedback, please feel free to leave a comment below.

    If you’re tired of managing your own servers – you might want to check out RunCloud (yep, that’s us!). RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. We provide painless server configuration so you don’t need to spend hours figuring it out – get started with RunCloud today & get up and running in minutes.

  • How to Test WordPress 6 — and Every Subsequent Release

    How to Test WordPress 6 — and Every Subsequent Release

    Is your website losing potential customers? Shocking statistics reveal that 64% of visitors abandon slow and glitchy sites!

    It’s vital that you test your websites thoroughly to provide your users with a first-rate browsing experience if you want to stand any chance of increasing your sales.

    In this article, we will detail the steps you need to follow for setting up a WordPress staging environment and will demonstrate exactly how it can be used to test your website’s updates.

    Our step-by-step guide will ensure your site is always running smoothly and keeping customers happy.

    Let’s get started!

    Understanding New WordPress Releases

    At the time of writing, WordPress 6.2 is the latest release of WordPress (with 6.3 due to be released around August of 2023). This current release includes several major changes and enhancements that make web development easier.

    For instance, the new default theme, Twenty-Twenty-Three, now includes ten style variations – which gives you a lot of flexibility in developing your new site.

    One of the key highlights released is the enhancements in Query Loop blocks functionality. In addition to this there have been improvements in block placeholders which provide better consistency and control, and more responsive text with fluid typography.

    You can track the latest release of WordPress on the new releases page.

    Although new features make life easier, they sometimes cause compatibility issues with the existing site, especially if your site uses plugins or themes that have not been tested with the latest version. It’s a good idea to test that everything works before upgrading your website.

    That’s where a solid staging environment comes in.

    What is WordPress Staging?

    A staging environment is a duplicate copy of your website where you can try out and thoroughly test any changes – without affecting the original site.

    It’s often used to test and preview the changes to themes and plugins before making them live on the actual website. This way, website owners can test changes without any risk of disrupting users’ experiences on the live site.

    Why Do You Need to Test WordPress?

    Running and maintaining a staging site alongside your production site might seem like double the effort. However, doing this can save countless hours in debugging. Here are a few scenarios where it’s especially useful:

    1. A staging site allows developers to work more efficiently as they don’t need to worry about the potential repercussions from any failure. If you’re making changes to a live site, you’ll take regular backups and carefully inspect everything before making each change. If your site is being actively developed, this can take a lot of time. Having a sandbox environment to test and refine changes makes the development process faster.
    2. By testing the changes on a test site you can catch and fix issues before they go live. The ability to identify and proactively fix the issues even before they show up in your live environment makes it immensely valuable for businesses that cannot afford downtime.
    3. Multiple developers can work simultaneously on the staging site without worrying about clashes and overwriting each other’s work. This can speed up the development time and reduce miscommunications.

    When Should You Use WordPress Staging?

    There are many scenarios where using a test environment is helpful. Here are some of the common examples:

    1. Updating WordPress core, themes, or plugins: With WordPress, plugins can conflict with each other, leading to errors or crashes. With staging websites you can test new plugins, or updates to existing plugins, without risking the stability of the live site.
    2. Design changes: Website owners can experiment with different design changes, such as a new color scheme, layout, or font, all without affecting the live site. This is much more useful than having a mockup of the design, because the staging site can be viewed on different devices to test both responsiveness and accessibility.
    3. E-commerce changes: For e-commerce websites staging is especially useful when testing new payment gateways, product listings, or other updates that could affect the checkout process.

    Setting Up a Test Environment

    Step 1: Back Up Your Site

    Ensure that you have a working backup of your site. If you don’t have a recent copy, you can use RunCloud’s automated backup functionality to quickly create a snapshot of your site. If you’re not using RunCloud to manage your servers yet, you can use a WordPress plugin such as WP Migrate Lite, or Duplicator to make a copy of your site.

    create staging site using LocalWP

    Step 2: Setup A Test Environment

    You need to create a consistent testing environment that closely resembles your actual hosting environment. This means you should use the same operating system, PHP version, and libraries in your staging environment. Ideally your test environment should not have anything running except your test site so that it’s isolated from all potential problems.

    If you don’t have a fresh virtual machine then you can use tools such as Vagrant for building and managing virtual machine environments. It’s a customizable and scalable solution for advanced users who require more control over their development environment.

    In this tutorial, we’ll be working with Local, a WordPress development environment. It’s specifically designed for testing WordPress sites. Start by downloading the Local binary on your computer and execute it.

    The binary file will automatically download and install the necessary packages for your computer. Once you’re done, you should see a screen that looks something like this:

    LocalWP empty screen

    Step 3: Import Your Backup Into The Test Environment

    Click on “Create a new site” and select the option to use an existing zip file. Locate the backup of your live website, and use that backup to create a new site.

    Import Archive LocalWP

    Use the preferred settings for a seamless experience, and click “Import site”. Your firewall might prompt you to allow network access, so make sure you grant this access for a smooth installation.

    choose environment WordPress

    Step 4: Make The Changes To The Staging Site

    Once your site has been imported, click on the “Open site” button on the top right to view your staging site. Now you can log into your admin dashboard as you normally would, with the same credentials that you use for your live site.

    LocalWP dashboard staging

    Once you have the site up and running, you can access it on your local network and collaborate with other team members – all completely without affecting the live site.

    After you have thoroughly tested the compatibility of your plugins and themes, you can make those changes on your live site without worrying about unexpected repercussions.

    If you only made a few minor edits to your staging site, such as changing some text or colors, you can post these changes to your live site by manually implementing them. For example, you can edit the same file or setting on your live site, and then copy-paste the changes from your staging site. In this way, you can avoid overwriting your entire live site and preserve any user-generated data.

    However, if you made a complex operation on your staging site, such as installing a new plugin or theme, adding custom code, or modifying the database, it may be wise to take a backup of your staging site – and overwrite your existing live site with it. This way, you can ensure that your live site matches your staging site exactly, and avoid any compatibility issues or errors. Before you do this, however, make sure you have a backup of your live site as well in case something goes wrong.

    Creating A Staging Site on RunCloud

    If you’re using RunCloud to manage your servers, then you can create a staging site with just a few clicks. RunCloud can automatically clone entire WordPress sites without requiring you to download anything.

    To use RunCloud’s staging feature, go to your dashboard and open the “Staging” menu to set up a test environment. Click on the “Get Started” button to begin the process.

    RunCloud dashboard staging WordPress

    RunCloud will now ask you to enter the username and password that visitors will need to enter for browsing this site. This is not your WordPress admin dashboard password – your staging site will have the same login credentials as your production site.

    You can turn off this option if you like. However, we recommend you keep this on as making the test site publicly available might potentially reveal some confidential information.

    configure staging environment WordPress

    After configuring the access control of your site, you can configure the domain that you want to use. You can either use a different subdomain of your original site, or use a test domain.

    Configure staging domain RunCloud WordPress

    After configuring the necessary settings, deploy the app by clicking the “Deploy Staging” button. Once deployed, you should see the following screen. Click on the “Open Site” button in the top right corner of the screen to browse your staging site.

    staging WordPress settings RunCLoud

    After opening the site, you should see an alert asking you for login credentials. Enter the username and password that you just created. You should now be able to browse your site and make changes to it without affecting your main site.

    HTTP authentication RunCloud WordPress

    After making the changes, you can go back to the staging dashboard and click on the “Sync” button to push changes from the test environment to the production.

    WordPress Staging Plugins

    Many WordPress backup and migration plugins also provide the option to create a staging environment. Here are some of the best WordPress staging plugins.

    1. WP StageCoach
      WP Stagecoach provides the ability to easily create sandbox sites. It has some advantages over importing a backed-up copy of your test site, as it merges the database rather than overwriting the existing one. There are also some advanced features, such as protecting staging sites via a password, or offering the ability to revert changes instantly.
    2. WP Staging
      The WP STAGING plugin for WordPress allows users to create backups, staging sites, and clones of their website. Some advanced features included are support for multisite networks, and migration to another host or domain – although these are locked behind a paywall. The staging environment can quickly test updates and restore backups if necessary, making it a good choice for managing your staging environment.
    3. BlogVault Staging
      BlogVault is a WordPress backup plugin that also provides a staging environment. It can perform incremental automatic backups, and can revert to previous versions easily. This quick backup and recovery process allows you to speed up your development, as you’ll spend more time testing and less time waiting for backups.

    The staging site runs on a separate server instead of running alongside your live site. This allows you to load-test the staging site without worrying about any possible performance impact on your live site.

    After Action Report

    It is essential to test any changes before pushing them to your live site. This is even more important if you’re running a business that relies on a website for its core services. Staging environments are a great way to test your site in a sandbox environment without worrying about compatibility issues.

    We strongly encourage all WordPress site owners to test new releases and stay up to date with the latest software updates. This not only ensures that your site is functioning optimally but it also helps to ensure your site is secure. Outdated software can leave your site vulnerable to security threats, which can have serious consequences for your business.

    If you’re tired of managing your own servers – you might want to check out RunCloud (yep, that’s us!). RunCloud is built for website owners that want to focus on their customers, not on managing their infrastructure. Experience painless server configuration, backups, and worry-free staging environment migration, without the need to spend hours figuring it out – get started with RunCloud today and get up and running in minutes. Get started with RunCloud today and get up and running in minutes.

  • How To Install Magento

    How To Install Magento

    Magento 2 is a popular e-commerce platform that powers thousands of online stores around the world.

    If you’re planning to set up an online store using Magento 2, you can do this easily on RunCloud.

    In this article, we’ll guide you through the process of installing Magento 2, along with all of the necessary dependencies.

    Let’s get started!

    System Requirements

    Before we start the installation process, it’s important to ensure that the system meets the minimum requirements for running Magento. This section will provide a list of requirements, and instructions for checking your system’s compatibility.

    Magento 2.4.6 has the following requirements:

    1. Operating System: 64-bit Linux
    2. Web Server: Apache 2.4, Nginx 1.8
    3. PHP: 8.1 or 8.2 (along with the necessary PHP extensions)
    4. MySQL: 8.0
    5. Composer: 2.2
    6. Search and Analytics Engine: Elasticsearch 8.4, 7.17 or AWS OpenSearch 1.2

    Installing The Necessary PHP Extensions

    If you don’t have all of the necessary extensions, you can install them on your server by running the following command. Simply log in via SSH, copy the following command, and paste it into your terminal:

    sudo apt-get install php-intl php-gd php-zip php-bcmath php-curl php-mysqlnd php-soap php-ctype php-dom php-fileinfo php-iconv php-json php-mbstring

    Make sure you run the above command with superuser permissions. After running the command you will be asked whether you want to install the listed extensions – press ‘Y’ to continue with the installation.

    Once done, you will need to reload the PHP-FPM service. You can do this by running the following commands:

    systemctl reload php81rc-fpm
    systemctl reload php82rc-fpm
    

    Installing Elasticsearch

    Magento 2 needs a search engine installed on your machine to work properly. Some popular choices are Elasticsearch and OpenSearch.

    We have covered this topic in more detail on our blog in a post titled How To Install Elasticsearch. However, if you are in a hurry, you can use the following commands to quickly install it. Just log into your server with the necessary privileges and run these commands:

    wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
    sudo apt-get install apt-transport-https
    echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
    sudo apt-get update && sudo apt-get install elasticsearch
    sudo systemctl daemon-reload
    sudo systemctl enable elasticsearch.service
    sudo systemctl start elasticsearch.service
    

    After the installation is complete, you can check if Elasticsearch is working as expected by running the following command:

    curl http://localhost:9200

    You should get an output similar to the screenshot shown below:

    curl request to Elasticsearch on localhost in terminal

    Creating A Database

    We recommend creating a separate database and user for Magento 2. RunCloud makes it easy to add and manage database users on your server. In this section, we’ll walk you through the process of creating a new database for your Magento 2 installation.

    Open your RunCloud dashboard and locate the server that you want to use. In the “Databases” tab, look for the “Database Users” tab. Once you find it, click “Add New Database User” to create a new account. Provide the necessary login credentials, and then make sure you save it.

    Creating database user in RunCloud dashboard

    After creating the database user, go back to the “Databases” tab. Click on “Add New Database” and give it a suitable name. Don’t forget to grant access to the user that we just created.

    After you have created the database, save it – and continue with the installation.

    creating database in RunCloud dashboard

    Downloading Magento 2

    After you have completed all the prerequisites for Magento 2 we can proceed with the installation. Go to your RunCloud dashboard and create a new application. Pick an “Empty Web App”, and then fill in all the necessary details.

    Creating Web Aplication on RunCloud

    In the Basic settings and Stack section, add /pub in the public path and don’t forget to use a supported version of PHP. At the time of writing, the latest version of Magento (2.4.6) supports only PHP 8.1 and PHP 8.2.

    After your application has been created, you will need to log into your server to start the installation. The following commands need to be executed as the “Owner of the web application”, so make sure you are logged in as the correct user. In the above screenshot, the owner of the application is “runcloud”.

    You can use the “whoami” command to find out the name of the current user. If you are logged in as a different user, you can use the “sudo su” command, followed by the name of the desired user to log into their account.

    check current user in Linux

    Once you have logged in successfully, use the “cd” command to navigate to the root directory of your project. If you are not sure what your root directory is, you can find it in the RunCloud dashboard.

    In the project directory, you can use the following commands to remove the default index.html file and download the installation files for the Magento Community Edition.

    rm -rf pub/
    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .

    During the installation, you will be asked to provide a username and password for downloading the files. Although Magento is free, it was acquired by Adobe, and so you will now be required to have an Adobe account.

    In this tutorial, we will only be using Magento, which is the free version of Adobe Commerce. To get your username and password, go to the Adobe Commerce Dashboard and log in with your Adobe credentials.

    obtaining API keys from Adobe Commerce dashboard

    In the dashboard you can create a new access key free of charge. Once you have generated the key, enter the “Public Key” in the username field, and the “Private Key” in the password field. You should note that text entered in the password field is not displayed for security purposes, but all keystrokes are being recorded.

    Configuring API keys Magento2

    Installing Magento 2

    With the system requirements met, files extracted, and database created, it’s time to start the Magento 2 installation process. To begin the installation, copy and paste the command below into a text editor and make the following changes:

    1. Add the base URL with the URL of your website
    2. Add the name of the database using the database that we created
    3. Add the username and password of the database user
    4. Configure the login information of the administrator user
    5. Set your preferred currency and timezone.
    bin/magento setup:install \
    --base-url=http://www.example.com/ \
    --db-host=localhost \
    --db-name=<database-name> \
    --db-user=<username> \
    --db-password=<database_password> \
    --admin-firstname=admin \
    --admin-last name=admin \
    --admin-email=admin@example.com \
    --admin-user=admin \
    --admin-password=admin123 \
    --language=en_US \
    --currency=USD \
    --timezone=America/Chicago \
    --use-rewrites=1 \
    --search-engine=elasticsearch8 \
    --elasticsearch-host=localhost \
    --elasticsearch-port=9200 \
    --elasticsearch-index-prefix=magento2 \
    --elasticsearch-timeout=15
    Magento2 installation on Linux

    After making the changes, you can run the above command in your terminal to begin the installation, which should take 5-6 minutes. If you follow all the steps correctly you will be greeted with the message below. You can then go to the URL of your website to visit your Magento store.

    Successful installation of Magento 2

    After the installation is finished, you can enable production mode using the following command.

    bin/magento deploy:mode:set production

    The above command will generate necessary static content for your website and enable several optimizations to serve content faster.

    After Action Report

    Installing Magento 2 might seem like a daunting task, but with this step-by-step guide you can set up your online store on RunCloud in no time. Once Magento 2 is installed, there are still a few post-installation steps you’ll need to take, such as verifying the installation, setting up the admin account, and configuring payment methods before you can start using your new online store. Refer to Adobe’s documentation to learn how to do this.

    If you’re ready to take your server management to the next level, sign up for RunCloud today. RunCloud is the perfect solution for you if you’re looking to make managing your servers easier. So why wait? Sign up now and start enjoying the benefits of RunCloud today!

  • Fixing Redirect Loop on Cloudflare SSL

    Fixing Redirect Loop on Cloudflare SSL

    If you are using Cloudflare proxy to hide your server’s IP address from the internet, then you might encounter a glitch that causes visitors to get stuck in a redirection loop.

    Eventually, the request times out with an error message saying, “Too many redirects”.

    In this article, we will investigate why websites might get stuck in a redirection loop and how you can prevent this.

    Let’s get started!

    Why Does This Happen?

    If you’re using Cloudflare to serve visitors, you’ll probably be using Cloudflare’s TLS certificate to securely transmit these web requests. When you’re using the Flexible SSL option, Cloudflare will connect to your site over an HTTP connection, and forward the response to visitors over an HTTPS connection.

    The Nginx or Apache2 server on your machine sees these requests before they are processed by WordPress. WordPress processes these requests over HTTP protocol – which causes your site to show a mixed content warning. This is where some content of your site is served over HTTP, whilst other content is transmitted over a secure connection.

    If you try to address this issue by manually updating URLs from HTTP to HTTPS, then you might get stuck in a redirection loop.

    This happens because when you configure your site to serve content over HTTPS, it will only serve it over HTTPS. If a user makes an insecure request, the server asks them to make a new request with an HTTPS connection. Usually this isn’t a problem, but if you have misconfigured your servers, an error will occur.

    How does Cloudflare proxy work?

    If Cloudflare servers make an insecure request to your site, and you redirect that back to another Cloudflare server, then it will cause an infinite loop. Each server will keep asking the other one to serve the request, until the maximum number of requests are reached.

    How To Fix This Issue?

    There are a few ways to fix this problem. Here are some of the easier ways to resolve the redirect loop problem.

    Using Cloudflare Page Rule

    One of the simpler ways to fix this problem is by updating the settings on your Cloudflare dashboard.

    You can configure Cloudflare’s redirect rules with status code 301 to indicate that the webpage has moved over permanently.

    In your Cloudflare dashboard, open the domain that you want to configure and look for the Redirect Rules section inside the Page Rules submenu. Then create a forwarding rule to tell Cloudflare to forward HTTP requests to HTTPS.

    A screen capture of Cloudflare dashboard showing screen capture page.

    For example, if your WordPress address is https://blog.runcloud.io, Create a rule for http://blog.runcloud.io/ and use the Full URL setting with 301 redirect. 

    Updating CloudFlare TLS settings

    To make sure that you don’t get stuck in redirection loops, use either the Full or Full (Strict) setting so that all the web requests are only made using the HTTPS connection.

    A screen capture of Cloudflare dashboard showing SSL/TLS settings.

    Using SSL Certificate In RunCloud

    If you are using RunCloud to manage your servers, you can easily configure TLS certificates for all your domains. Simply go to the domain section of your web-app and click the Configure SSL/TLS button for the domain that you want to secure.

    A screen capture of RunCloud dashboard showing how to edit domain name settings.

    Once you click the option, you’ll be asked to choose whether you want to use Let’s Encrypt or a different SSL provider, if you’re not sure about this, use Let’s Encrypt as it is free – and just as secure as other providers.

    After that, you can configure how you want to verify the ownership of your domain, and what kind of certificate you want. Unless you need something specific, you can leave these settings to the default values. 

    And finally, you need to specify what happens when someone tries to access your domain over insecure connections. We recommend using the HSTS option which asks all users to only use secure connections for all web requests. However, you should know that once you enable this option, you will not be able to serve any content over HTTP connections.

    A screen capture of RunCloud dashboard showing how to configure SSL/TLS settings.

    After Action Report

    The “too many redirects” error on Cloudflare can be frustrating, but it can be easily fixed by updating the misconfigured settings on your server. By following the steps outlined in this article, you’ll be able to update your website’s settings, and adjust your SSL certificates.

    If you’re still struggling to resolve the issue, you should consider switching to a more user-friendly server management platform like RunCloud. With RunCloud, you can easily manage your server and issue SSL certificates in just a few clicks, making it a great choice for WordPress users who want a hassle-free solution.

    If you feel that having a painless server configuration so you don’t need to spend hours figuring it out sounds like a good idea (and who doesn’t?) – get started with RunCloud today, and get up and running in minutes.

  • Upgrading Your Server’s Operating System on RunCloud

    Upgrading Your Server’s Operating System on RunCloud

    If you’re still using Ubuntu 18.04 LTS (Bionic Beaver), it’s time to start thinking about upgrading.

    As of May 31, 2023, Ubuntu 18.04 will reach its End of Standard Support (EOSS) date, meaning that it will no longer receive security updates, bug fixes, or technical support from Canonical.

    In this article, we’ll discuss the importance of upgrading from Ubuntu 18.04, the risks of staying on an unsupported system, and how to make the transition to a newer, supported version of Ubuntu.

    Effective June 1st, 2023: We will be discontinuing support for connections made using TLS 1.0. This decision aligns with industry standards and best practices to maintain a secure environment for all of our users. Learn more.

    What Is An EOL Version Of Ubuntu?

    EOL stands for end of life and is a tag given to all the releases of Ubuntu that are no longer being supported by Canonical, the company behind Ubuntu. This means that it will no longer receive any security updates, bug fixes, or new features.

    Running an EOL version of Ubuntu exposes your system to potential vulnerabilities, compatibility issues, and performance degradation.

    Using an EOL version poses several risks, such as:

    1. Vulnerabilities: An EOL version may have unpatched security flaws that can be exploited by hackers or malware. This can compromise your data, privacy, and system integrity.
    2. Compatibility: An EOL version may not be compatible with newer hardware, software, or standards. This can cause errors, crashes, or performance issues.
    3. Support: An EOL version will not include any technical support from the developer or vendor. This means that you’re on your own if you encounter any problems, or need help.

    You can see the list of all Ubuntu releases and their respective end-of-life dates on Ubuntu Wiki.

    What is LTS?

    LTS stands for Long-Term Support and is a tag given to Ubuntu releases with an even version number. For example, 18, 20, 22, and so on.

    LTS versions receive security updates and bug fixes for five years from their release date. This is much longer than ordinary releases that are typically supported for less than a year.

    Is Ubuntu 18.04 reaching EOL?

    No, Ubuntu 18.04 is an LTS release and it will reach the end of standard support on May 31, 2023 – it’s different from End of Life.

    Although it’s highly recommended to move to a newer version of Ubuntu, it might not be possible for everyone to do this before June 2023. Ubuntu 18.04 servers that are subscribed to Ubuntu Pro or Canonical Embedding Programme will continue to receive essential updates for another 5 years and will reach its End of Life in April of 2028.

    How To Identify Your Ubuntu Version

    You can check whether you are using the latest version of Ubuntu in the RunCloud dashboard. Open your server page, and at the top, you will see the current version of Ubuntu that’s running.

    You can also check the status of your Ubuntu Pro subscription and the current Ubuntu version from the terminal. Log into your server using SSH, and execute the following commands:

    uname -r # Check Kernel version
    pro status # Check Ubuntu Pro status
    lsb_release -a # Check Ubuntu version

    How To Upgrade Ubuntu To The Latest Version On RunCloud

    RunCloud strongly recommends you avoid upgrading your existing server. Instead, you should create a new server and migrate to it.

    There are several advantages of doing this:

    • Upgrading existing servers may cause compatibility issues with the software or hardware.
    • Upgrading existing servers may overwrite some of the existing configuration, security, or device settings.
    • Creating new servers and migrating to them allows us to take advantage of new technology or better services that may not be available on the old servers.

    We recommend you follow the following steps to move to a newer version of Ubuntu.

    Note: Before you back up and upgrade your server, you need to make sure that your app is compatible with a higher PHP version. Ubuntu 18.04 supports PHP 7.0 and 7.1, but Ubuntu 20.04 only supports PHP 7.2 and above. Therefore, you need to move your app to at least PHP 7.2 before you proceed with the backup and upgrade process. You can use RunCloud’s dashboard to change the PHP version for your web application. This step is not required for containerized servers, as they use their own container images for PHP.

    Backup Your Existing Applications

    We have written an extensive blog article outlining how to perform backups. Here’s a quick summary.

    Start by opening the web application in the RunCloud dashboard, and then go to the “Backups” tab.

    While creating the backup, make sure you select the “Web Application and Database” option. After that, select your desired storage option, and configure other basic settings.

    Once your backup is completed, you will see a “Completed” status next to it.

    Provision A New Server

    While the backup is in process, you can provision a new server. We have an in-depth knowledge base article that explains how to connect a server to RunCloud.

    You can read it and follow along, but just make sure that you select the latest version of Ubuntu, 22.04 LTS, while creating the new server.

    Migrating Applications

    Provisioning a server and creating backups takes just a few minutes. Once both are complete, you can begin migrating your application. We strongly recommend you do this at a time when you don’t get a lot of traffic to your site in order to minimize potential disruptions.

    We have an in-depth knowledgebase article that explains How to clone a web application to another server, but here’s a quick summary.

    Open the “Web Application” dashboard in RunCloud, and click on “Cloning”.

    Select the newly created server, and provide the new names for both the web application and database which will be used on the new server.

    After that, if you’re using RunCloud’s Cloudflare integration, your DNS records will be updated automatically.

    However, if you wish to update your records manually, you might want to read our guide on How To Speed Up DNS Propagation first.

    That’s it!

    Your application should be up and running on the new server. If you have multiple applications, you’ll need to perform the above steps for each application.

    Testing The Migration

    Once you have completed the migration, you can visit the website and check its IP address in the DevTools menu. The remote address field should show you the IP address of the new server. If you’re still seeing the old IP address, clear your browser cache and retry after a few minutes.

    Once your new site is up and running, we recommend keeping the old server alive for a few days while you perform tests on the new server. Ideally, you should test every user sign-up form and checkout process to make sure everything is working properly.

    TLS 1.0 Support Will Be Discontinued

    As of June 1st, 2023, RunCloud will no longer accept connections made using TLS 1.0. This decision aligns with industry standards and best practices to maintain a secure environment for all of our users.

    Why Is TLS 1.0 Being Deprecated?

    TLS 1.0 is an outdated encryption protocol that has been found to have security vulnerabilities and weaknesses. By discontinuing support for TLS 1.0, we are prioritizing your data security and protecting it from potential threats.

    What action do you need to take?
    To ensure uninterrupted access to the RunCloud panel, we kindly ask you to take the following actions before the deprecation date:

    1. Update your browser: Ensure that you are using a modern web browser that supports TLS 1.1 or higher. Popular browsers like Google Chrome, Mozilla Firefox, Microsoft Edge, and Safari have already dropped support for TLS 1.0 and offer more secure versions.
    2. Verify server compatibility: Check if your server environment supports TLS 1.1 or higher. Most modern server configurations already have the necessary protocols enabled. If you are unsure or need assistance, please reach out to our support team, and we will be happy to help.
    3. Upgrade your application: If you are using any third-party applications or integrations that communicate with the RunCloud panel, ensure they support TLS 1.1 or higher. If necessary, update those applications to ensure compatibility.

    We understand that this change may require some adjustments on your end, but it is necessary to maintain a secure environment for all our users. We apologize for any inconvenience caused and appreciate your cooperation in this matter.

    If you have any questions or need further assistance, please don’t hesitate to contact our support team. We are here to guide you through this transition and address any concerns you may have. Thank you for being a valued RunCloud customer. We remain committed to providing you with a secure and reliable hosting experience.

    After Action Report

    It’s clear that upgrading to the latest version has several benefits such as improved security, performance, support, compatibility, and features. In this article, we also highlighted the risks of using unsupported versions of Ubuntu, such as vulnerabilities, compatibility issues, lack of support, and missing out on new features.

    If you follow the steps outlined in this article, you’ll be able to migrate to the latest version of Ubuntu with minimal disruptions.

    After the upgrade is complete, it’s a good idea to install a monitoring agent, such as New Relic, to check for errors on your server. Read our blog post that explains How To Install New Relic Monitoring on RunCloud.

    RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. We provide painless server configuration so you don’t need to spend hours figuring it out – get started with RunCloud today and get up and running in minutes.

  • How to Install Craft CMS

    How to Install Craft CMS

    Craft is a Content Management System (CMS) that is focused on doing one thing, content management. Different from WordPress, it doesn’t provide you with fancy widgets or themes – it is designed to be minimal and fast.

    In this article, we will show you how easy it is to install and configure Craft CMS when you are using RunCloud to manage your servers.

    Create An Empty Web App

    Start by opening your RunCloud dashboard. Then, proceed to create a Web Application using RunCloud Panel, as shown in the picture below.

    Give it a descriptive name and scroll down.

    Deploying new application on RunCloud dashboard

    Configure your domain name, for quick and easy setup, we recommend integrating RunCloud with Cloudflare API, which automatically handles adding and removing DNS records.

    New webapp on RunCloud dashboard

    Craft CMS recommends using PHP 8.1 and later versions for a better experience. Don’t forget to append /web to your public path, as shown below. If you don’t modify your public path, you’ll need to delete the web application and start all over again.

    Basic settings RunCloud dashboard

    Open Project Directory

    Log into your server via SSH and browse to the root directory of your web application. You can find the root path in the RunCloud dashboard.

    Application Overview RunCloud PHP 8.2

    Copy the root path and use the cd command to navigate to the root directory in the terminal. For the above example, the command would look like this

    cd /home/runcloud/webapps/craft4

    Once you have opened your web app, remove the empty index.html file from your project, you can run the following commands to delete the file and remove the empty folder.

    rm ./web/index.html
    rmdir web/

    After running the above commands, go back to the RunCloud dashboard – don’t close the terminal yet!

    Create A Database And User

    Once you have deleted the file, we can proceed with the installation of Craft CMS, for that, we will need access to a database. Luckily, RunCloud makes it super easy to create new users and manage access.

    Simply go to your RunCloud dashboard and pick the server that you are using. Locate the Databases tab on the left and open the “Database Users” submenu.

    Create a new database user and give it a secure password. Once you have created it, it should look something like this.

    Create Database in RunCloud

    After creating the database user, go back to the database tab and create a new database. Make sure to grant access to the user that we just created. After creating the database, it should look similar to the screenshot below.

    Create a new Database on RunCloud

    Installing The Craft CMS

    After creating the database, we can begin the installation.

    Go back to the terminal and make sure that you are in the root directory of your project. You can run the pwd command to check your working directory, the output of this command should match the root path displayed in the RunCloud dashboard.

    Once there, make sure that you are not running as a superuser, you can check the name of your current user by running the whoami command. The output of this command can be anything except “root”. For example, in the below example, we are running the system as “runcloud” user.

    Craft CMS installation terminal

    If you are running the shell as root user, you can imitate other users by running the following command. Just replace “runcloud” with the name of another user.

    sudo su runcloud

    Once you are sure that you are in the correct directory with correct permissions, run the following command to install the Craft CMS using PHP 8.2 and Composer.

    /RunCloud/Packages/php82rc/bin/php /usr/sbin/composer create-project craftcms/craft .

    After running the command, it will ask you if you want to begin the installation, type “yes” to start it. Leave the database driver, IP address, and database port filed empty and press enter to accept default values.

    In the database username, password, and name field, enter the details that we just created in the previous step. After this, enter some random alphabets for database prefix.

    CRAFTCMS on Linux RunCloud

    Once you have entered the database details, you should be greeted with a message saying “Testing database credentials … success!”. After that you can configure the login credentials for the administrator account. Use a secure username and password.

    In the Site name, enter the name of the site that you want to display to users, for the site URL option, enter the complete URL of your web-application. If the URL is long and hard to memorize, you can just copy and paste the URL from the RunCloud dashboard.

    Installing CraftCMS on Ubuntu

    Once you have completed the above steps, installation should automatically continue and deploy your site. Once it is completed, you can open the URL in a browser and should be greeted with a screen that looks like this.

    CraftCMS home screen Welcome

    Troubleshooting

    After installation is complete, log into your dashboard and navigate to Utilities> System report. Once there, scroll down to the bottom, you should see a green check mark next to each of the options.

    In the following example, we have a warning mark next to some of the entries, we can click on “i” next to it to get more information. If that specific functionality is useful for you, then you can change this in the RunCloud dashboard.

    health checks, System Overview CraftCMS

    To change these settings, open the web app in the dashboard and navigate to the Settings tab. Once opened, scroll down to the PHP settings section and modify the settings accordingly.

    If the text in the disabled functions field is too hard to read, you can press Ctrl + f in your browser to use the find function, which highlights the text on the page, as shown below. Once satisfied, don’t forget to click “Update PHP Settings” to save the changes.

    PHP settings RunCloud dashboard

    Now you can go back to the Craft CMS dashboard and refresh the page, all the warnings that you tackled should have disappeared.

    CraftCMS system errors

    After Action Report

    Craft CMS is a popular content management system that focuses on security and performance over all other aspects of the application.

    It supports plugins and themes that can extend its functionality and improve user experience, but they are not available by default.

    If you are looking for an easy and painless way to manage your servers, RunCloud is the perfect solution for you. With its intuitive dashboard and powerful features, RunCloud makes it easy to manage your servers and deploy applications. Start using RunCloud today and see how it can simplify your infrastructure.

  • How to Install and Setup A WordPress Multisite Network

    How to Install and Setup A WordPress Multisite Network

    Are you tired of managing multiple WordPress sites individually? Then say ‘goodbye’ to the hassle and ‘hello’ to efficiency with WordPress Multisite Network!

    Discover how you can manage all your sites from one dashboard with ease using this game-changing feature.

    In this guide, we’ll walk through what a WordPress multisite network is and discuss whether you should use one. We will also cover the benefits of using a multisite network and then explain how to set up a WordPress multisite network correctly.

    Let’s get started!

    What Is WordPress Multisite Network?

    WordPress multisite is a feature in WordPress that allows you to run multiple websites on just one WordPress installation. This is different from running multiple WordPress engines on the same server. In a multisite network, the network admin has access to all of the sites in the network.

    The WordPress multisite feature is often used by large organizations that need multiple websites for different units, departments, or entities within their overall structure.

    For example, if a university wants to give all its professors their own blog column on the university website, they can do so using WordPress’s multisite feature. Similarly, a large newspaper agency might have one common site for all articles, but have different WordPress sites for each of its categories, such as sports, finance, politics, etc – with each of these websites being operated and maintained by the respective departments.

    Benefits Of Using A Multisite Network

    • Instead of managing multiple sites separately, you can access and control everything from one dashboard, which simplifies management.
    • When running multiple WordPress sites, you might need to maintain multiple servers. In addition to the hosting cost, it will also cost you more to maintain and upgrade these servers. Having one bigger server with multiple sites reduces server cost to some extent.
    • Launching a new site is quick and easy. You can simply go to the dashboard and with the click of a few buttons, your site will be up and running in less than ten seconds.
    • Running a multisite network makes it easier to enforce security policies and manage everything. The network admin can manage plugins, themes, and users for all sites from one dashboard.
    • Multisite networks make it easier to maintain a consistent brand identity across multiple sites.
    • If you use different servers for each of your sites, then you’ll need to monitor the traffic on them separately. This means you’ll need to upscale and downscale each server if traffic spikes or dips momentarily. On a multisite network, if you are using a bigger server to handle all your traffic, it will provide you better resilience to unforeseen traffic spikes.

    Domain-based vs. Path-based Multisite Networks

    WordPress provides two types of multisite network installations, so you can pick the one that suits your needs best.

    Domain-Based Multisite Network

    This option provides a separate domain name for each of your websites. This is especially useful for large organizations which might want to move one of the websites to a different server in the future. Having a separate domain gives you the freedom to manage each site independently in the future.

    While this option does provide some flexibility, it comes with a few caveats. Most notably, you will need to manage a lot of domain names if you have a number of sub-sites. Domain names are infamous for being difficult to manage, and having multiple subdomains will only make the job harder. Moreover, unless you are using a wildcard SSL, you will need separate SSL certificates for each of your domains.

    Path-Based Multisite Network

    If you are happy with all of your sites running on the same domain, then this is the right option for you. It is ideal for bloggers and small businesses that need the additional functionality of multisite networks without all the hassle of managing DNS records.

    Installing A WordPress Multisite Network

    RunCloud makes it really easy to set up and install a multisite network. If you aren’t already using RunCloud for managing your servers, sign up to RunCloud today and follow along.

    1. Log in to your RunCloud dashboard and select the server that you want to use. If you already have a server with some spare capacity connected to your RunCloud account, you can use that. If not, you can connect to a new server. Once connected, click “Deploy New Web App”.
    1. On the “One-Click” installation tab, select “WordPress” and give a descriptive name to your application. This name will not be displayed to your visitors.
    1. In the ‘Domain’ section, add the domain that you want to use – this will generate the DNS records for your site. RunCloud’s Cloudflare integration makes it easy to set up DNS records – just select the API key and everything works magically. However, if you are not using RunCloud’s Cloudflare integration you can manually add the DNS records to your nameserver. Usually, the nameserver is managed by your domain registrar.
    1. Next, you will need to configure the SSL/TLS settings for your site. We recommend enabling AutoSSL.
    1. Set the name and other details of your WordPress site. Be sure to use a strong password, and check everything carefully.
    1. From the dropdown menu, select the type of multisite network that best suits your needs.
    1. Once you have configured your WordPress settings, continue setting up your application. Enable backup to automatically backup your website at set intervals, and choose the latest version of PHP to take advantage of up-to-date security upgrades.
    1. Once you have configured all of the settings, click the “Deploy My Site” button at the bottom right of your screen to launch the application.

    Adding Sites to the Network

    1. Once you have deployed your main site from the RunCloud dashboard, you no longer need to open RunCloud to deploy additional sites. Log in to WordPress and open the Network Admin dashboard.
    1. Navigate to the “Sites” tab and click on “Add New” to create a new site.
    1. Add the site address, title, and the admin email in the respective text boxes, and then click “Add Site”. If you are using a subdirectory based network, the URL of the site will be different, but the process is essentially the same.
    1. Once you have added the site it should be visible in the Network Admin dashboard. Repeat the last step to create additional sites.
    1. This step is only applicable to domain-based site networks; if you are using the path-based multisite network, you can skip this step.

    After you have created a site on a new domain, you need to add DNS records so people on the internet will know where the site is hosted.

    You can add “A records” for each individual subdomain if you like. However, a simpler option would be to just use CNAME records that point to your root domain. This way, if you switch servers in the future, you will only need to update one value.

    The exact steps needed to add a DNS record will vary from one provider to another, but the record values remain the same. Simply look for the CNAME record option, and enter the subdomain prefix that you created in the WordPress dashboard (in the “name” field). Next, add “@” in the value/target field to point this record to your root domain and then save it.

    1. In the dashboard, hover on the site name to reveal additional options for the site. You can click on the “Dashboard” link to open the dashboard of the new site. If you are not able to view your site immediately, wait for a few minutes for the DNS setting to propagate through the internet.

    Managing the Network

    Managing Users

    1. In the Network Admin dashboard, open the Users tab to manage users. Click on “Add New” to add a new user, and then add any necessary details to create the new user.
    1. Once the user has been added, you can go to the Users submenu to view all active user accounts, edit account privileges, or delete user accounts.

    Managing Plugins

    You can also add plugins to your WordPress multisite network from the plugins panel in the admin dashboard.

    1. Click on “Add New” to open the WordPress plugins directory. From there, you can search for new plugins, and add them just as you normally would.
    2. Once the plugin is installed, you can enable it across the network, i.e., install it for all the sites on the network. Similarly, you can also either upgrade or delete it for all sites.

    Managing Themes

    1. On your WordPress multisite installation, open the Network Admin dashboard. There you can find the “Installed Themes” submenu.
    1. In the Theme menu, you can add, remove, or upgrade themes for all sites across the network. Many people find this option very useful, as having a consistent theme across all sites provides a better user experience.

    After Action Report

    Managing a multisite network can be challenging, but with the right tools and knowledge, it can be very useful for your organization.

    Maintaining a multisite network has several advantages over running individual sites. The most prominent advantage is the ability to manage all the sites, users, plugins, and themes from a single dashboard, thereby saving both time and server resources.

    For a seamless experience, sign up for RunCloud, the leading server management platform. We’ve made it easy to manage WordPress multisite networks. Learn more about WordPress Multisite in the context of WaaS platforms in our blog post here.

  • How to Send Email from PHP (With Guided Walkthrough)

    How to Send Email from PHP (With Guided Walkthrough)

    In most cases, we normally recommend using transactional email services such as Mailgun, Amazon SES, or Mandrill rather than sending emails from your own service. But if you are feeling enthusiastic you can even set up your own server too.

    That’s what we’re going to cover in this article.

    Take your tech skills to the next level with our easy-to-follow guide on how to send emails from PHP! No need to worry about complicated code – our step-by-step walkthrough makes it a breeze. This guide will guide you through setting up your own mailing service on your Ubuntu server or other similar Debian distros.

    Ways to Send Email From PHP

    There are multiple ways of sending emails from PHP, but the two most basic ones are:

    • Using the mail() function: This is the built-in PHP function for sending email. It is a simple and easy-to-use option for sending basic emails.
    • Using a library or framework: Several libraries and frameworks are available for PHP that make it easier to send emails. Some popular options include PHPMailer and SwiftMailer.

    Using external mail packages such as SwiftMailer or PHPMailer is generally recommended over PHP’s built-in mail function because they offer more advanced features and functionality. While the mail function can be useful for sending basic emails, it has very limited capabilities.

    One major limitation of the mail function is that it doesn’t allow you to add attachments to your emails. This can be a significant issue if you need to send files or documents as part of your communication.

    In addition, using the mail function can make it difficult to meet industry standards, and build trust with Google and other email providers. Establishing trust and following best practices are both crucial for ensuring that your emails are recognized as safe and secure. This can be challenging with the mail function, as it doesn’t provide the necessary tools and capabilities to meet these standards.

    These are two of the most compelling reasons to use external mail packages such as SwiftMailer or PHPMailer instead of PHP’s built-in mail function. However, if you are still interested in learning how to send emails from a PHP web server, you are in the right place! While it may not be the most efficient or effective option, there is still significant value in understanding how to use the mail function and other methods for sending emails from PHP.

    How to Send Email With PHP From Web Server in 5 Steps

    The process of sending an email with PHP from your web server is fairly simple, so we’re going to break it down into five steps.

    1. Install Dependencies

    Installing dependencies is the first step in setting up your PHP application to send email. Dependencies are external libraries or packages that your application requires to function properly.

    First, we will install Sendmail and GNU Mailutils on the server. To install these tools, enter this command:

    sudo apt update && sudo apt install mailutils sendmail-base

    2. Update The sendmail_path Inside php.ini

    You will need to update the php.ini file to let PHP know where sendmail is located. This file can be located at either “/etc/php74rc/php.ini” or “/etc/php/7.4/apache2/php.ini”. If you are using a later version of PHP then run php -v to find out what version you are using, and update the path accordingly.

    The php.ini file is pretty big, and it’s hard to parse all the information in a terminal editor. We will use the following command to find out the exact line number of the setting so we can jump directly there:

    cat -n /etc/php74rc/php.ini | grep "sendmail"

    Note down the line numbers displayed on the left of the text. Next, we will edit the /etc/php74rc/php.ini file. You can use your favorite terminal editor, or simply paste the following command to open the nano editor.

    sudo nano /etc/php74rc/php.ini

    Scroll down to the line number we noted, and search for “sendmail_path =”. It should look something like this:

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    ;sendmail_path =

    Uncomment the sendmail_path by removing the ; and add the sendmail path. The default value is “/usr/sbin/sendmail -t -i”. You should have something like this:

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    sendmail_path = /usr/sbin/sendmail -t -i

    Now press Ctrl + O to save the file. Press Enter to confirm the filename and location, and press Ctrl + X to exit the editor. Now when you run the ‘cat -n /etc/php74rc/php.ini | grep “sendmail”’ command, you should see the updated path.

    Now restart the php service with:

    systemctl restart php74rc-fpm

    3. Change hostname

    Now we will edit the server hostname. You can find the hosts file at /etc/hosts. Update the localhost address as shown below.

    # Old Value

    127.0.0.1      localhost.localdomain localhost 

    # New Value

    127.0.0.1      test.runcloud.me test

    And then we change the hostname on the fly with:

    hostname test.runcloud.me

    4. Configure sendmail

    Now we need to configure the sendmail CLI. We can do this by running the following command, and entering the necessary details:

    sendmailconfig

    5. The Basics of PHP Mail Function

    You can use the following PHP code to use the inbuilt PHP mail function:

    mail($to, $subject, $message, $headers)

    That is the basic way to start sending email from your server. Here’s an example of real-world usage:

    <?php
    $to = 'youremail@gmail.com';
    $subject = 'This is a test email';
    $message = 'Hello john!';
    $from = 'jane@runcloud.me';
    $headers = sprintf("From: %s\r\nReply-To: %s", $from, $from);
    mail($to, $subject, $message, $headers);

    Now add the mail.php inside your web application. Make sure you have replaced the $from variable to your own email address.

    It is important to keep in mind that simply sending an email from your PHP web application doesn’t guarantee that it will be delivered to the recipient’s inbox. There are many factors that can influence whether an email is delivered, and it’s not uncommon for emails to be caught by spam or security filters.

    For example, Google has many filters in place to identify and block potentially malicious or spammy emails. For your emails to pass these filters and reach the recipient’s inbox, they need to meet certain security and quality standards.

    By following the steps to send email from PHP, you will have the basic ability to send emails from your web application. However, to ensure that your emails are delivered effectively and avoid being caught by filters, you will need to focus on security attributes and other factors that can help your emails pass spam and security checks. This may require additional effort and attention to detail, but is essential for ensuring that your emails are delivered safely and successfully.

    How To Make Sure Your Email Sent From PHP Will Be Delivered

    Although you’re now set up to send emails from PHP, the next task is to ensure that your emails include certain standards and attributes to pass spam checks, and actually end up in the inbox of your recipients.

    In this section, we will go through the process of testing your email for deliverability using services such as mail-tester and mailook which help identify the probability of your email getting flagged as possible spam.

    Testing Your Email Deliverability.

    Open up either of the mail testing websites, and you should get an email address to send it to. Add this email to your $to variable, and you should get something like this:

    <?php
    $to = 'web-ovl78@mail-tester.com';
    $subject = 'This is a test email';
    $message = 'Hello john!';
    $from = 'jane@runcloud.me';
    $headers = sprintf("From: %s\r\nReply-To: %s", $from, $from);
    mail($to, $subject, $message, $headers);

    Now visit the mail.php again inside your browser; this should execute the code again and send another email. Check the score of this mail from the Mail Tester. This is our result:

    With this score, your email will never reach any inbox! This is expected and we will configure a few settings, which will increase the score dramatically.

    Setting SPF Records

    Sender Policy Framework (SPF) is the TXT-based DNS record that you can add to your DNS as a policy for sending emails. Your server hostname needs to be verified as an email sender.

    You can use SPF Wizard to generate your SPF record. We are using the following records for our test domain (runcloud.me).

    runcloud.me. IN TXT "v=spf1 a:test.runcloud.me -all"
    test.runcloud.me. IN TXT "v=spf1 ip4:45.118.132.8 -all"

    Don’t forget to change your a:<your own domain> and ip4:<your server IP>

    This is how it looks like when you query the DNS records from Cloudflare.

    Let’s break this down line-by-line to get a better understanding. In the given configuration, the first line tells the internet that test.runcloud.me can send email on behalf of runcloud.me. So your outgoing emails will look like jane@runcloud.me even though our actual domain is test.runcloud.me.

    The second record tells the internet that the mail server for test.runcloud.me is located at the given IP address(es). The ~all bit at the end of each record tells everyone that they should ignore all the emails which do not originate from the given server.

    Having done that, we sent the email to the Mail Tester as before and then checked the score.

    This is a significant improvement. However, some inboxes might still refuse the email.

    Setting MX Records

    Mail servers also check for MX records, and the domain (runcloud.me) doesn’t have any MX records. Because of this, it gets a penalty. We will add an MX record to improve it further, and check the score again after adding this.

    This time we 9/10 which is much better. If you are not getting the same score, wait for a few hours so that modified TXT records are propagated across the servers. Learn more about How to speed up DNS propagation.

    Setting PTR Record

    Your server reverse IP lookup should return your server hostname (test.runcloud.me). You can do this from the Digital Ocean or Linode panel if you are using their service. Alternatively, any IaaS-based company that provides VPS/Server will always give you access to modify your PTR record.

    Setting DKIM Record

    DomainKeys Identified Mail (DKIM) is a digital signature that verifies the authenticity of a given email and checks whether it was authorized by the owner of the domain. Learn more about why your mail server needs a DKIM record.

    All modern email service providers support DKIM, simply create new CNAME records with the given values, and it should work automatically.

    Setting DMARC Record

    Domain-based Message Authentication, Reporting & Conformance (DMARC) is a validation system that makes it harder for malicious actors to spoof your domain and send emails on your behalf. Although it is optional, it is recommended to use it if your email provider supports it.

    You can create a new DNS record with values provided by your email server to use it.

    After creating all the records, our score has significantly improved. It is very close to a perfect score, but it is not there yet. In our testing, we used a shared email server that was flagged as spam in the past 28 days. This is expected, and it should not matter to most of the people.

    However, if this is unacceptable, you can rent a private IP address and use it to send emails. If you don’t send spam messages, it will slowly build the reputation of your IP address, and your emails will get closer to a perfect score.

    Using SSL/TLS To Connect Securely

    You should be connecting SSL/TLS. Failing to do so will result in Gmail blocking your email, as you can see in Google’s help documentation.

    If you encounter any errors, you can check the /var/log/maillog or var/log/mail.log file on your terminal to see the mail server logs. This is particularly handy for fetching information about postfix, smtpd, and other email-related services running on your server.

    You can simply run the following command to view a continuous stream of logs in your terminal.

    tail -f /var/log/mail.log

    After adding all of these certificates and policies, and making your web server fully compliant with industry standards, you should be able to send emails using PHP from your webserver without deliverability issues.

    Conclusion

    In conclusion, sending emails from PHP is viable, but using external email packages such as SwiftMailer or PHPMailer is generally recommended. These packages offer more advanced features, and better reliability, and can save you time, money, and effort. Additionally, using an external email package can increase your chances of successful email delivery.

    If you do choose to send emails from your web server using PHP, it is important to follow this guide carefully and pay attention to factors such as deliverability, security, and industry standards. This may require additional effort, but it is necessary to ensure that your emails are delivered safely and effectively.

    To make the process of sending email from PHP even easier and more reliable, consider using a platform like RunCloud. With RunCloud, you can easily set up and manage your PHP web server, install dependencies, and send email without the hassle. Start using RunCloud today!