{"id":1927,"date":"2025-02-21T16:36:14","date_gmt":"2025-02-21T14:36:14","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/run-drupal-ddev-developer-servers\/"},"modified":"2025-02-21T16:36:14","modified_gmt":"2025-02-21T14:36:14","slug":"run-drupal-ddev-developer-servers","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/run-drupal-ddev-developer-servers\/","title":{"rendered":"How to run Drupal with DDEV on UpCloud Developer Cloud Servers"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Drupal is an open-source content management system (CMS) that powers millions of websites globally, from e-commerce stores to enterprise-level apps and government sites.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Running Drupal on UpCloud\u2019s Developer Cloud Servers enables easy scalability and increases performance. In this guide, we outline the installation, setting up, and running of Drupal on UpCloud servers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why you should run Drupal on UpCloud<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">UpCloud&#8217;s high-performance servers offer several advantages, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scalability<\/strong>\u2014UpCloud allows you to quickly <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/scale-cloud-servers-hot-resize\/\">scale up your CMS resources without downtime<\/a> based on your business&#8217;s demands. This ensures your Drupal site remains responsive and robust when in high demand.<\/li>\n\n\n\n<li><strong>Performance<\/strong>\u2014Our enterprise-grade CPUs and in-house-built storage technology offer the best-in-class cloud server performance for most applications.<\/li>\n\n\n\n<li><strong>Reliability<\/strong>\u2014We provide an outstanding 99.999% uptime SLA on our Cloud Native and General Purpose plans, ensuring the availability of your Drupal sites and backed by our 24\/7\/365 real-time support.<\/li>\n\n\n\n<li><strong>Flexibility<\/strong>\u2014UpCloud offers a wide range of server configurations and managed services for developing, building, and deploying.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1. Deploying a new Developer Cloud Server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these steps to set up your UpCloud server and install Drupal:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sign up with UpCloud<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can begin by registering with <a href=\"https:\/\/signup.upcloud.com\/\">UpCloud<\/a> using your name and email address. You then get a one-week free trial to explore the development environment, which lets you familiarize yourself with our services at no upfront cost.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Set up your UpCloud server<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>1.  Once you\u2019ve signed up and logged in, it\u2019s time to set up a <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/deploy-server\">new cloud server<\/a>.<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li>2.  On the <strong>Dashboard<\/strong>, click on <strong>Servers<\/strong> in the top left of the screen.<\/li>\n<\/ol>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>3.  When choosing your server location, look for <strong>the nearest data centre<\/strong> to minimize latency and lag for remote connections.<\/li>\n<\/ol>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>4.  Select your <strong>server plan<\/strong>. It pays to start small with the minimum requirements and scale up as needed.<\/li>\n<\/ol>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>5.  Choose your <strong>operating system<\/strong>. This guide uses Ubuntu but you can choose from a list of popular Linux distribution template.<\/li>\n<\/ol>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>6.  Add your SSH key to log in, and click <strong>Deploy<\/strong> to launch your server.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">2. Set up a Docker-based development environment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One of the best ways to get started with Drupal is to set up a <a href=\"https:\/\/www.drupal.org\/docs\/develop\/local-server-setup\/docker-based-development-environments-for-macos-linux-and-windows\" target=\"_blank\" rel=\"noopener\">Docker-based development environment<\/a>. This will prepare your UpCloud server for easy Drupal installation. For example, you can choose from these popular Docker-based solutions with over 500 stars in their GitHub repositories.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ddev.com\/\" target=\"_blank\" rel=\"noopener\">DDEV<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.lando.dev\/\" target=\"_blank\" rel=\"noopener\">Lando<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/wodby.com\/docker4drupal\" target=\"_blank\" rel=\"noopener\">Docker4Drupal<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docksal.io\/\" target=\"_blank\" rel=\"noopener\">Docksal<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">We will be using DDEV in this tutorial.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Log into your new Developer Cloud Server<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To begin, <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/quick-start-guide\/\">log into your Cloud Server<\/a> using SSH on your terminal or PuTTY client.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@your_server_public_ip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Update and upgrade<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first thing on a new server is to always update all software.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add Docker keys and repositories<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we&#8217;ll need to add Docker GPG keys and sources to our package manager.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install ca-certificates curl<br>sudo install -m 0755 -d \/etc\/apt\/keyrings<br>sudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc<br>sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc<br>echo \\<br>&nbsp;&nbsp;\"deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] \\<br>    https:\/\/download.docker.com\/linux\/ubuntu \\<br>&nbsp;&nbsp;  $(. \/etc\/os-release &amp;&amp; echo \"${UBUNTU_CODENAME:-$VERSION_CODENAME}\") stable\" | \\<br>&nbsp;&nbsp;  sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install Docker<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the Docker repositories configured, install Docker itself.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update<br>sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the Docker this way allows the system to then keep the software up to date using the standard update commands as demonstrated above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install DDEV<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, set up the DDEV&#8217;s GPG key similarly to Docker and add DDEV releases to your package repository.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo install -m 0755 -d \/etc\/apt\/keyrings<br>curl -fsSL https:\/\/pkg.ddev.com\/apt\/gpg.key | gpg --dearmor | sudo tee \/etc\/apt\/keyrings\/ddev.gpg &gt; \/dev\/null<br>sudo chmod a+r \/etc\/apt\/keyrings\/ddev.gpg<br>echo \"deb [signed-by=\/etc\/apt\/keyrings\/ddev.gpg] https:\/\/pkg.ddev.com\/apt\/ * *\" | \\<br>sudo tee \/etc\/apt\/sources.list.d\/ddev.list &gt;\/dev\/null<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, update the package information on your server and install DDEV.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update<br>sudo apt-get install -y ddev<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will also need to run a one-time initialization of mkcert.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkcert -install<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, you will need to set up a new user account to run DDEV commands.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">adduser ddev<br>adduser ddev sudo<br>adduser ddev docker<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then set your password and switch to the new user account.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">passwd ddev<br>cd \/home\/ddev &amp;&amp; su ddev<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Deploy a new Drupal site<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Having installed both Docker and DDEV, we are now ready to deploy our Drupal site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new directory to house your website files and switch into it using the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir ~\/my-drupal-site &amp;&amp; cd ~\/my-drupal-site<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, run the following commands to configure the new Drupal project, start the services, and install the latest server software and the Drush command-line configuration tool.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ddev config --project-type=drupal11 --docroot=web<br>ddev start<br>ddev composer create drupal\/recommended-project:^11<br>ddev composer require drush\/drush<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Complete Drupal installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you have deployed your Drupal site, you should see it in action. But before we can view the page, we need to reconnect our SSH to enable port tunnelling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, check what port your site is running at using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ddev describe<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then find the URL\/PORT of your HTTP site. It&#8217;ll look similar to the example below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">- web:80 -&gt; 127.0.0.1:32768<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make note of the port number, then reconnect SSH to your Cloud Server while including the following <em>address:port<\/em> pair where the port should match the website&#8217;s port number<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh -L 127.0.0.1:32788:127.0.0.1:32788 root@your_server_public_ip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve reconnected to your Cloud Server, launch the Drupal installation wizard by navigating to <code>http:\/\/localhost:32788<\/code> on your web browser. Follow the on-screen instructions to complete the setup. Remember to replace the port number at the end of the address with the port your Drupal site is running.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start by choosing your site&#8217;s language, then click the <em>Save and continue<\/em> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/1-drupal-setup-wizard-1024x564.png\" alt=\"Drupal setup choose language\" class=\"wp-image-47714\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, select the installation profile based on your use case.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/2-drupal-install-profile-1024x564.png\" alt=\"Drupal setup choose installation profile\" class=\"wp-image-47715\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then enter your site details as you prefer and set up your administrator account. When done, click the <em>Save and continue<\/em> button once more.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/3-drupal-configure-site-708x1024.png\" alt=\"Drupal setup configure site\" class=\"wp-image-47716\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The installation will take a moment, but once complete, you&#8217;ll land on the Drupal main page with notifications confirming your Drupal installation was successful!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/4-drupal-website-1024x998.png\" alt=\"Drupal site welcome page\" class=\"wp-image-47717\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">5. Additional configuration options<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring Drupal helps optimize its performance and security. Here are a few pointers.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Enable server caching<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You can optimise Drupal\u2019s page loading by enabling caching in the server settings. Log into your Drupal site and navigate to the following section:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Administration &gt; Configuration &gt; Development &gt; Performance<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the duration of your cache in the drop-down box, then click the <em>Save configuration<\/em> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/5-drupal-caching-settings.png\" alt=\"Drupal site cache settings\" class=\"wp-image-47718\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Also, while in the Performance settings, check that the Bandwidth optimization settings are enabled.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/6-drupal-bandwidth-optimizations-1024x362.png\" alt=\"Drupal site bandwidth optimization settings\" class=\"wp-image-47719\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Hardened Permissions and Access Control<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Once you are done configuring your site, change the <em>settings.php<\/em> file to read-only for the web to ensure that file permissions follow best practices.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod 444 web\/sites\/default\/settings.php<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should also edit the <em>~\/my-drupal-site\/web\/.htaccess<\/em> file to disallow direct access to sensitive directories like \/config, \/vendor, and \/scripts.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;DirectoryMatch \"^.*\/(config|vendor|scripts)\"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;Order Allow,Deny<br>&nbsp;&nbsp;&nbsp;&nbsp;Deny from all<br>&lt;\/DirectoryMatch&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Automated backups<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up scheduled automated backups is an important way to protect your hard work. You can use <strong>DDEV&#8217;s snapshots with cron jobs<\/strong> or enable whole server snapshots with the <a href=\"https:\/\/upcloud.com\/global\/docs\/guides\/taking-backups\/\"><em>UpCloud Simple Backup<\/em><\/a> service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ddev add-on get ddev\/ddev-cron<br>ddev restart<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then create a new cron job file ~\/my-drupal-site\/.ddev\/web-build\/snapshots.cron and add the following line into it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Take a snapshot once a day<br>0 17 * * * ddev snapshot<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Later on, if you ever need to revert changes, you can restore a snapshot using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Restore a snapshot<br>ddev snapshot restore my-drupal-site_20250218120425<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also protect your whole Cloud Server by enabling <strong>scheduled Simple backups<\/strong> at your UpCloud Control Panel. On Developer plan servers, backup plans start from just 30 cents while General Purpose plans and higher have one day backups included for free.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/7-drupal-simple-backups-1024x700.png\" alt=\"UpCloud Developerl Cloud Server backup options\" class=\"wp-image-47720\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Further resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide is designed to help you get started with Drupal on UpCloud Developer Cloud Servers. Several excellent resources are available with Drupal and UpCloud to help you make the most of the Drupal CMS hosting experience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\">UpCloud advanced user setup guides<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials?cat=security\">Security on UpCloud<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.drupal.org\/docs\/user_guide\/en\/index.html\" target=\"_blank\" rel=\"noopener\">Drupal user guide<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.drupal.org\/documentation\" target=\"_blank\" rel=\"noopener\">Drupal documentation<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This step-by-step guide helps you quickly and easily set up Drupal\u2019s CMS system using DDEV tools on UpCloud\u2019s versatile Developer Cloud Servers. Alongside its reliability and ultra-fast speeds, UpCloud Block storage makes our Cloud Servers the ideal hosting space for Drupal\u2019s outstanding CMS solutions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In addition to reliability, high speeds, and block storage, UpCloud helps you scale. Begin small without breaking the bank and scale without compromising on performance as your usage grows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/signup.upcloud.com\/\">Sign up for a free trial<\/a> today to begin developing your Drupal site on UpCloud!<\/p>\n","protected":false},"author":3,"featured_media":47711,"comment_status":"open","ping_status":"closed","template":"","community-category":[250],"class_list":["post-1927","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=1927"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1927\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=1927"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=1927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}