# Lightest possible setup for wordpress website

**URL:** <https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410>\
**Category:** Community Support\
**Created:** [December 31, 2022, 10:49pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410 "2022-12-31T22:49:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![knoffs](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/knoffs/32/3680_2.png) [@knoffs](https://forum.hestiacp.com/u/knoffs)\
**Post date:** [December 31, 2022, 10:49pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/1 "2022-12-31T22:49:29Z")

</div>

hi,  
what would be the lightest possible setup to run a wordpress site and making sure it runs very fast?

on this page i found a very easy light setup. does anybody use this kind of setup? do you have any recommendations?

> **[Optimize HestiaCP for speed and fast WordPress – Random IT Hacks](https://rand.1to.one/optimize-hestiacp-for-speed-and-fast-wordpress/)**

* * *

**Nginx + PHP + MySQL/MariaDB – without Apache**.

```auto
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

sudo bash hst-install.sh --apache no --phpfpm yes --multiphp no --vsftpd no --proftpd no --named no --mysql yes --postgresql no --exim yes --dovecot yes --sieve no --clamav no --spamassassin no --iptables yes --fail2ban yes --interactive yes

```

This will give us minimal installation, without BIND (DNS), and only EXIM as mailing solution.

## 3. Set WordPress template and caching

Login to control panel and your user.

#### Set tamplate

- Edit Web domain → Advanced Options → Web Template → WordPress

#### Set caching

- Enable Fast CGI Cache
- Set Cache duration → 5m, 10m  
_(if you have a lot of dynamic content, you can try microcache of 30s)._

That’s it on the HestiaCP side, now your website should be crazy fast. For further optimisations, look into optimizing WP plugins and theme code.

---

<div class="post-metadata">

**Author:** ![jlguerrero](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/jlguerrero/32/954_2.png) [@jlguerrero](https://forum.hestiacp.com/u/jlguerrero)\
**Post date:** [December 31, 2022, 11:27pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/2 "2022-12-31T23:27:51Z")

</div>

I agree with that.

---

<div class="post-metadata">

**Author:** ![desp](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/desp/32/4044_2.png) [@desp](https://forum.hestiacp.com/u/desp)\
**Post date:** [January 4, 2023, 10:27pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/3 "2023-01-04T22:27:16Z")

</div>

I want to add to this guide interesting thing related to hestiaCP nginx & cloudflare.  
By default cloudflare will NOT cache static resources with `wordpress` nginx template.

I do talk about this  
 ![](https://i.imgur.com/Bn9AJY2.png)

On the screenshot it’s HIT. I.e. correct behavior. Means: static resources like js files, css files, images - cached by cloudflare and downloaded from cloudflare servers instead of my hestiaCP.

How to check?  
CTRL + SHIFT + C or F12 in Edge or Google Chrome → Network tab.  
CTRL + R or CTRL+F5 (mark button on screenshot above: “disable cache”)  
and you will see headgears (if you click on any file).

You will see there MISS. This is default behavior.  
But why? If you have enabled caching, and you have headers for cache (max-age) why do you have MISS?

Here is a thing: [Default Cache Behavior · Cloudflare Cache (CDN) docs](https://developers.cloudflare.com/cache/about/default-cache-behavior/)

I.e. you must to have have both: max-age & Cache-Control header public.  
 ![](https://i.imgur.com/XRPwtnC.png)

How have I fixed it for myself (i’m not sure that if this is right thing to do, I need some professional to comment this).

> <https://github.com/hestiacp/hestiacp/blob/793a344886e546ead4c871bc45252650e13e744d/install/deb/templates/web/nginx/php-fpm/wordpress.stpl#L42>

(i have ubuntu 22.04)  
I went here: /usr/local/hestia/data/templates/web/nginx/php-fpm

and made copy-paste of these 2 files:

- wordpress.tpl
- wordpress.stpl

to:

- mywordpress.tpl
- mywordpress.spl

Inside both mywordpress files

in block:

```location
        try_files $uri $uri/ /index.php?$args;
        location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
            expires 30d;
            fastcgi_hide_header "Set-Cookie";
        }

```

I’ve added just 1 line:

> add\_header Cache-Control “public”;

So I got next looking block (in both files)

```auto
    location / {
        try_files $uri $uri/ /index.php?$args;
        location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
            expires 30d;
            add_header Cache-Control "public";
            fastcgi_hide_header "Set-Cookie";
        }

```

![](https://i.imgur.com/SabStVi.png)

After that I saved files.  
And changed wordpress template in hestiaCP admin for website to mywordpress template.  
Cleaned cached on Cloudflare side.

And now I have dramatically increased hit rate on cloudflare side.

![](https://i.imgur.com/AuCvTBD.png)

---

<div class="post-metadata">

**Author:** ![jlguerrero](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/jlguerrero/32/954_2.png) [@jlguerrero](https://forum.hestiacp.com/u/jlguerrero)\
**Post date:** [January 5, 2023, 7:01pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/4 "2023-01-05T19:01:08Z")

</div>

@eris static files should be cached for more than 1 year according to pagespeed.

How about we increase that value?

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 5, 2023, 7:30pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/5 "2023-01-05T19:30:03Z")

</div>

If you have some details on a longer term please share them…

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 5, 2023, 7:44pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/6 "2023-01-05T19:44:30Z")

</div>

Redownloading static files should be fine every 30 days. I don’t think it will “save” it will matter a lot. Except for pagespeed score that in that cases is overrated…

I have enabled add\_header Cache-Control “public”; to one of my client site an will look if it helps bit…

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 5, 2023, 7:46pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/7 "2023-01-05T19:46:44Z")

</div>

The screenshot doesn’t tell the full story as php pages are never cached an if your theme has a view counter is even less likely.

Unless we have a longer period then it would be use full to see.

---

<div class="post-metadata">

**Author:** ![andrew-kalinin](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@andrew-kalinin](https://forum.hestiacp.com/u/andrew-kalinin)\
**Post date:** [January 6, 2023, 1:17pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/8 "2023-01-06T13:17:37Z")

</div>

maybe developers would like to fix quick installer for wordpress installation?

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 6, 2023, 1:19pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/9 "2023-01-06T13:19:06Z")

</div>

Quick installer should work fine I use it a lot…

---

<div class="post-metadata">

**Author:** ![andrew-kalinin](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@andrew-kalinin](https://forum.hestiacp.com/u/andrew-kalinin)\
**Post date:** [January 6, 2023, 1:45pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/10 "2023-01-06T13:45:15Z")

</div>

1.6.14  
Quick install wordpress error

```auto
2023/01/06 13:43:15 [error] 975#0: *2328 FastCGI sent in stderr: "PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/hestia/web/templates/pages/setup_webapp.html:68

```

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 6, 2023, 2:02pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/11 "2023-01-06T14:02:57Z")

</div>

Run: v-list-sys-php json

---

<div class="post-metadata">

**Author:** ![andrew-kalinin](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@andrew-kalinin](https://forum.hestiacp.com/u/andrew-kalinin)\
**Post date:** [January 6, 2023, 2:07pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/12 "2023-01-06T14:07:12Z")

</div>

[  
“5.6”,  
“7.0”,  
“7.1”,  
“7.2”,  
“7.3”,  
“7.4”,  
“8.0”,  
“8.1”  
]

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 6, 2023, 2:21pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/13 "2023-01-06T14:21:17Z")

</div>

Error on:

1.6.14  
Quick install wordpress error

```auto
2023/01/06 13:43:15 [error] 975#0: *2328 FastCGI sent in stderr: "PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 195PHP message: PHP Warning: Undefined property: Hestia\System\HestiaApp::$1 in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Attempt to read property "json" on null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 206PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/src/app/System/HestiaApp.php on line 241PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/hestia/web/templates/pages/setup_webapp.html:68

```

> <https://github.com/hestiacp/hestiacp/blob/b0356cb2fa8e7de833342d0a7165e223a8a9399e/web/src/app/System/HestiaApp.php#L193-L195>

It looks like something is wrong with the `v-list-web-domain user domain json`

Please create a new topic about it is not related to the issue above…

---

<div class="post-metadata">

**Author:** ![knoffs](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/knoffs/32/3680_2.png) [@knoffs](https://forum.hestiacp.com/u/knoffs)\
**Post date:** [January 6, 2023, 3:34pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/14 "2023-01-06T15:34:54Z")

</div>

would be interesting to have a default hestia wordpress template file for cloudflare selectable. i assume many are using cloudflare nowadays

---

<div class="post-metadata">

**Author:** ![knoffs](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/knoffs/32/3680_2.png) [@knoffs](https://forum.hestiacp.com/u/knoffs)\
**Post date:** [January 6, 2023, 6:42pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/15 "2023-01-06T18:42:26Z")

</div>

when using the method to install wordpress described here, is there a need/advantage to install the „hestia nginx cache“-plugin?

> **[Hestia Nginx Cache](https://wordpress.org/plugins/hestia-nginx-cache/#)**
>
> Purge Nginx cache automatically after making website changes. Uses the new HestiaCP API, released in 1.6.0.

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 6, 2023, 7:15pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/16 "2023-01-06T19:15:56Z")

</div>

Yes it usefull …

---

<div class="post-metadata">

**Author:** ![knoffs](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/knoffs/32/3680_2.png) [@knoffs](https://forum.hestiacp.com/u/knoffs)\
**Post date:** [January 6, 2023, 7:59pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/17 "2023-01-06T19:59:20Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [January 6, 2023, 8:56pm UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/18 "2023-01-06T20:56:22Z")

</div>

I use it on all my sites that use wordpress and even it is not perfect it is easier then the alternatives with custom templates and building nginx your self

---

<div class="post-metadata">

**Author:** ![kingscrownsolutions](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/kingscrownsolutions/32/5846_2.png) [@kingscrownsolutions](https://forum.hestiacp.com/u/kingscrownsolutions)\
**Post date:** [February 14, 2024, 6:36am UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/19 "2024-02-14T06:36:47Z")

</div>

Hey I tried to do this but in my panel I cannot see the options to change the template, could you please help me in finding out what am I missing or doing wrong?

 ![image](https://forum.hestiacp.com/uploads/default/original/2X/f/fc12f67b22f77ebb4f4357a5c50ca93a0079d607.png)

---

<div class="post-metadata">

**Author:** ![eris](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/eris/32/1241_2.png) [@eris](https://forum.hestiacp.com/u/eris)\
**Post date:** [February 14, 2024, 7:21am UTC](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410/20 "2024-02-14T07:21:27Z")

</div>

You have Apache2+Nginx instead of Nginx standalone…

[Next page](https://forum.hestiacp.com/t/lightest-possible-setup-for-wordpress-website/8410.md?page=2)
