<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Craft CMS Archives - LinuxTuto</title>
	<atom:link href="https://www.linuxtuto.com/tag/craft-cms/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.linuxtuto.com/tag/craft-cms/</link>
	<description>Linux Sysadmin and DevOps blog</description>
	<lastBuildDate>Wed, 05 Jul 2023 12:00:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.linuxtuto.com/wp-content/uploads/2022/01/cropped-LT_faveicon-32x32.png</url>
	<title>Craft CMS Archives - LinuxTuto</title>
	<link>https://www.linuxtuto.com/tag/craft-cms/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">201456972</site>	<item>
		<title>How to Install Craft CMS on Debian 12</title>
		<link>https://www.linuxtuto.com/how-to-install-craft-cms-on-debian-12/</link>
					<comments>https://www.linuxtuto.com/how-to-install-craft-cms-on-debian-12/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Wed, 05 Jul 2023 12:00:05 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Composer]]></category>
		<category><![CDATA[Craft CMS]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=1417</guid>

					<description><![CDATA[<p>Craft CMS is a popular content management system (CMS) that allows users to create and manage websites and digital experiences. It is known for its...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-craft-cms-on-debian-12/">How to Install Craft CMS on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Craft CMS is a popular content management system (CMS) that allows users to create and manage websites and digital experiences. It is known for its flexibility, powerful features, and user-friendly interface. Craft CMS is developed by Pixel &amp; Tonic, a software development company.</p>
<p>In terms of performance and scalability, Craft CMS is designed to handle websites of all sizes, from small blogs to large enterprise solutions. It utilizes a modern technology stack and provides caching mechanisms to optimize page loading times.</p>
<p>The Craft Plugin Store offers a wide range of plugins for various purposes, such as e-commerce, SEO optimization, analytics, and integrations with third-party services.</p>
<p>In this tutorial, we will guide you through the process of installing Craft CMS on Debian 12 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Operating System</span></h2>
<p>The first step is to ensure that your system is up-to-date. You can do this by running the following command:</p>
<pre><code># apt update &amp;&amp; sudo apt upgrade</code></pre>
<p>Also, install necessary packages.</p>
<pre><code translate="no"># apt install sudo nano wget unzip zip</code></pre>
<p>Now create a new <strong>non-root</strong> user account with <code>sudo</code> privileges and switch to it.</p>
<pre><code># /usr/sbin/adduser craftcms

# /usr/sbin/usermod -aG sudo craftcms

# su - craftcms
</code></pre>
<p><span style="color: #ff0000;"><strong>NOTE:</strong></span> <em>You can</em> <em>replace <code>craftcms</code> with your username.</em></p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Install Nginx Web Server</span></h2>
<p>Craft CMS requires a web server to run, and we will be using the Nginx web server in this tutorial. To install Nginx, run the following command:</p>
<pre><code>$ sudo apt install nginx</code></pre>
<p>You can start the Nginx service and configure it to run on startup by entering the following commands:</p>
<pre><code>$ sudo systemctl start nginx
$ sudo systemctl enable nginx</code></pre>
<p>Verify the status of the <code>Nginx</code> service using <code>systemctl status</code> command:</p>
<pre><code>$ sudo systemctl status nginx</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: </span><span class="has-inline-color has-vivid-purple-color">Install PHP and PHP extensions for Craft CMS</span></h2>
<p>To install PHP and additional PHP modules to support Craft CMS, run the following command:</p>
<pre><code>$ sudo apt install php php-cli php-common php-json php-gmp php-fpm php-xmlrpc php-bcmath php-imagick php-curl php-zip php-gd php-mysql php-xml php-mbstring php-xmlrpc php-intl</code></pre>
<p>Verify if PHP is installed.</p>
<pre><code>php -v</code></pre>
<pre><code><strong>Output:</strong>
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies
</code></pre>
<p>After installing all the packages, edit the php.ini file:</p>
<pre><code>$ sudo nano /etc/php/8.2/fpm/php.ini</code></pre>
<p>Change the following settings per your requirements:</p>
<pre><code>max_execution_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
date.timezone = America/Chicago</code></pre>
<p>To implement the changes, restart the <code>php-fpm</code> service:</p>
<pre><code>$ sudo systemctl restart php8.2-fpm</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Install Composer dependency manager</span></h2>
<p>To install Composer, run the following commands:</p>
<pre><code>$ sudo curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer</code></pre>
<p>Verify that Composer has been installed successfully by running the following command:</p>
<pre><code>$ composer --version
Composer version 2.5.8 2023-06-09 17:13:21
</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Install MariaDB </span><span class="has-inline-color has-vivid-purple-color">database server</span></h2>
<p>To install the MariaDB database server, run the following command:</p>
<pre><code>$ sudo apt install mariadb-server mariadb-client</code></pre>
<p>Verify the status of the MariaDB service using <code>systemctl status</code> command:</p>
<pre><code>$ sudo systemctl status mariadb</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 6: Create a New Database for Craft CMS</span></h2>
<p>Once you have installed MariaDB, you&#8217;ll need to create a new database and user for Craft CMS to use.</p>
<p>To do this, log in to your MariaDB server using the following command:</p>
<pre><code>$ sudo mysql -u root</code></pre>
<p>Run the following commands to create a new database and user:</p>
<pre><code>MariaDB [(none)]&gt; CREATE DATABASE craftcms;
MariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON craftcms.* TO 'craft'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
MariaDB [(none)]&gt; EXIT;</code></pre>
<p><strong><span style="color: #ff0000;">Note:</span></strong> Make sure to replace <code>'<strong>password</strong>'</code> with a strong password of your choice.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 7: Download and Install Craft CMS</span></h2>
<p>Create a new directory for your Craft CMS installation using the following command:</p>
<pre><code>$ sudo mkdir /var/www/craftcms</code></pre>
<p>Change ownership of the <code>/var/www/craft</code> directory to the <code>craftcms</code>user.</p>
<pre><code>$ sudo chown -R craftcms:craftcms /var/www/craftcms</code></pre>
<p>Then download the latest stable release of Craft CMS from the command line:</p>
<pre><code>$ cd /var/www/craftcms
$ composer create-project craftcms/craft .</code></pre>
<p>You will be asked to provide database details, admin username, password, site URL as shown below:</p>
<pre><code>Are you ready to begin the setup? (yes|no) [no]:<strong>yes</strong>
Which database driver are you using? (mysql or pgsql) [mysql] <strong>mysql</strong>
Database server name or IP address: [127.0.0.1] <strong>127.0.0.1</strong>
Database port: [3306] <strong>3306</strong>
Database username: [root] <strong>craft</strong>
Database password: <strong>password</strong>
Database name: <strong>craftcms</strong>
Database table prefix:
Install Craft now? (yes|no) [yes]:<strong>yes</strong>

Username: [admin] <strong>admin</strong>
Email: <strong>admin@your-domain.com</strong>
Password:
Confirm:
Site name: <strong>Your Website</strong>
Site URL: <strong>http://your-domain.com</strong>
Site language: [en-US] </code></pre>
<p>Change ownership of the <code>/var/www/craftcms</code> directory to <code>www-data</code>.</p>
<pre><code>$ sudo chown -R www-data:www-data /var/www/craftcms</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 8: Configure Nginx for Craft CMS</span></h2>
<p>Run the commands below to create a new VirtualHost file called <kbd>craftcms</kbd> in the <strong>/etc/nginx/conf.d/</strong> directory.</p>
<pre><code>$ sudo nano /etc/nginx/conf.d/craftcms.conf</code></pre>
<p>Paste the content as shown below:</p>
<pre><code>server {

  listen 80;

  server_name your-domain.com www.your-domain.com;
  root /var/www/craftcms/web;
  index index.html index.htm index.php;
  charset utf-8;

  location / {
    try_files $uri/index.html $uri $uri/ /index.php?$query_string;
  }

  location ~ [^/]\.php(/|$) {
    try_files $uri $uri/ /index.php?$query_string;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTP_PROXY "";
  }
}
</code></pre>
<p>Remember to replace <strong><code>your-domain.com</code></strong> with the domain name of your server.</p>
<p>Save and exit the configuration file.</p>
<p>To implement the changes, restart Nginx webserver:</p>
<pre><code>$ sudo systemctl restart nginx</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 9: Access Craft CMS Web Interface</span></h2>
<p>Open your web browser and type the URL <strong><code>http://your-domain.com</code></strong>. You should see the welcome screen:</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1426" src="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page.webp" alt="Craft CMS welcome page" width="900" height="429" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page-300x143.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page-768x366.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page-897x428.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_welcome_page-684x326.webp 684w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<p>To access Craft&#8217;s administrative interface type the URL <strong><code>http://your-domain.com/admin</code></strong> you should see the login page:</p>
<p><img decoding="async" class="aligncenter size-full wp-image-1428" src="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page.webp" alt="Craft CMS login page" width="900" height="427" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page-300x142.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page-768x364.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page-897x426.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_login_page-684x325.webp 684w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<p>Provide your admin credential and click on the <strong>Sign in</strong> button, you should see the <code>Craft CMS</code> dashboard in the following page:</p>
<p><img decoding="async" class="aligncenter size-full wp-image-1429" src="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard.webp" alt="Craft CMS dashboard" width="900" height="430" srcset="https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard.webp 900w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard-300x143.webp 300w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard-768x367.webp 768w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard-897x429.webp 897w, https://www.linuxtuto.com/wp-content/uploads/2023/07/craftcms_dashboard-684x327.webp 684w" sizes="(max-width: 900px) 100vw, 900px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Comments and Conclusion</span></h2>
<p>Congratulations! You have successfully installed <code>Craft CMS</code> with Nginx on Debian 12 OS. You can now create your own website easily using Craft CMS.</p>
<p>For additional help or useful information, we recommend you to check  <a href="https://craftcms.com/docs/" target="_blank" rel="noopener">the official Craft CMS documentation</a>.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-craft-cms-on-debian-12/">How to Install Craft CMS on Debian 12</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-craft-cms-on-debian-12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1417</post-id>	</item>
	</channel>
</rss>
