Self Hosted Applications: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
For a comprehensive list of many other options, check out the [https://github.com/awesome-selfhosted/awesome-selfhosted Awesome Self Hosted] list. | For a comprehensive list of many other options, check out the [https://github.com/awesome-selfhosted/awesome-selfhosted Awesome Self Hosted] list. | ||
== Content Management Systems == | == Content Management Systems == | ||
Many larger projects in web development will call for some kind of content management system (CMS). | Many larger projects in web development will call for some kind of content management system (CMS). | ||
=== General tips and | === General CMS tips and tricks === | ||
* We recommend using a PHP based CMS running on either a LAMP or LEMP stack. | * We recommend using a PHP based CMS running on either a LAMP or LEMP stack. | ||
Line 23: | Line 21: | ||
Website: https://www.drupal.org/ | Website: https://www.drupal.org/ | ||
==== When to use | ==== When to use ==== | ||
* Complex multisites that are interrelated | * Complex multisites that are interrelated | ||
* Larger clients especially government | * Larger clients especially government | ||
==== Tips and tricks | ==== Tips and tricks ==== | ||
* Import/export your content types, fields, views and site settings in JSON files for easier deployment on multiple environments | * Import/export your content types, fields, views and site settings in JSON files for easier deployment on multiple environments | ||
Line 38: | Line 36: | ||
Website: https://wordpress.org/ | Website: https://wordpress.org/ | ||
==== When to use | ==== When to use ==== | ||
* Configurable and scalable for clients of all sizes | * Configurable and scalable for clients of all sizes | ||
Line 44: | Line 42: | ||
* Larger clients can be setup with bespoke themes and plugins | * Larger clients can be setup with bespoke themes and plugins | ||
==== Tips and tricks | ==== Tips and tricks ==== | ||
* Avoid overcomplicating and overengineering things, try to follow the lessons of others who have tried to do the same things you're doing. | * Avoid overcomplicating and overengineering things, try to follow the lessons of others who have tried to do the same things you're doing. | ||
Line 58: | Line 56: | ||
=== Matomo === | === Matomo === | ||
Commercial Sponsor/s: N/A, open source | Commercial Sponsor/s: N/A, community backed open source project | ||
Website: https://matomo.org/ | Website: https://matomo.org/ | ||
==== When to use | ==== When to use ==== | ||
* There are many websites to manage | * There are many websites to manage | ||
* Customisation of interface and reports | * Customisation of interface and reports | ||
==== Tips and tricks | ==== Tips and tricks ==== | ||
* Put your logo and customise the skin with your own branding | * Put your logo and customise the skin with your own branding | ||
Line 79: | Line 77: | ||
=== Grafana === | === Grafana === | ||
Commercial Sponsor/s: N/A, open source | Commercial Sponsor/s: N/A, community backed open source project | ||
Website: https://grafana.com/ | Website: https://grafana.com/ | ||
==== When to use | ==== When to use ==== | ||
*Complex needs such as multiple systems in multiple locations | *Complex needs such as multiple systems in multiple locations | ||
*Customisation options such as monitoring specific services like Redis | *Customisation options such as monitoring specific services like Redis | ||
==== Tips and tricks | ==== Tips and tricks ==== | ||
* Setting up Prometheus can be a bit daunting and resources heavy, try using InfluxDB if you just have simpler needs | * Setting up Prometheus can be a bit daunting and resources heavy, try using InfluxDB if you just have simpler needs | ||
* There's a [https://grafana.com/grafana/dashboards/ huge database of user contributed dashboards] you can drop into your install with a copy and paste. | |||
== Search == | == Search == | ||
Line 102: | Line 101: | ||
Website: https://www.elastic.co/ | Website: https://www.elastic.co/ | ||
==== When to use | ==== When to use ==== | ||
*Better performance is needed, i.e. WooCommerce product search is unbearably slow | *Better performance is needed, i.e. WooCommerce product search is unbearably slow | ||
Line 109: | Line 108: | ||
**ELK combines Elastic Search, Logstash for gathering data from server log files and Kibana to provide a visual interface for analysts. | **ELK combines Elastic Search, Logstash for gathering data from server log files and Kibana to provide a visual interface for analysts. | ||
==== Tips and tricks | ==== Tips and tricks ==== | ||
* Elastic talks to other systems using simple GET requests via AJAX, making it very easy to talk to using PHP or Javascript code. | * Elastic talks to other systems using simple GET requests via AJAX, making it very easy to talk to using PHP or Javascript code. | ||
Line 115: | Line 114: | ||
== Virtualisation == | == Virtualisation == | ||
The heart of the cloud, virtualisation powers all the cloud giants offerings allowing them to spin up countless virtual machines on demand. | |||
When deploying self hosted applications for production use you'll probably be using a Virtual Private Server (VPS) from Amazon Web Services, Linode, Vultr, Digital Ocean or Microsoft Azure. | |||
Not to be confused with containerisation, self hosted virtualisation means using a physical computer on premise to host virtual machines, or VPS's. | |||
=== XCP-ng === | |||
Commercial Sponsor/s: N/A, community backed open source project | |||
Website: https://xcp-ng.org/ | |||
==== When to use ==== | |||
*On premises testing, development and staging environments | |||
*Recycling old PC's to provide services | |||
==== Tips and tricks ==== | |||
* Create a base machine with defaults you like, for example latest Ubuntu LTS, your own logins and any configuration you want. | |||
** Create new virtual machines by cloning from this base machine, and also periodically update it with the latest fixes | |||
* There is a free monitoring program for Windows, it's old but very powerful | |||
* The web based monitoring tool is OK, but a bit pushy about paying for a pro version with additional features | |||
[[Category:Hardware and systems]] | |||
[[Category:Software development]] | |||
[[Category:Web development]] |
Latest revision as of 15:26, 12 January 2024
Self hosting applications allows you to experiment with different solutions, save on cloud costs and create new offerings.
This curated list is based on our experiences to help you on your way.
For a comprehensive list of many other options, check out the Awesome Self Hosted list.
Content Management Systems
Many larger projects in web development will call for some kind of content management system (CMS).
General CMS tips and tricks
- We recommend using a PHP based CMS running on either a LAMP or LEMP stack.
- When using PHP-FPM and MariaDB/MySQL, make sure you fine tune your production systems with the correct configuration.
- See this pull request for fine tuning MariaDB/MySQL
- See this pull request for fine tuning PHP FPM
- Sometimes you'll need to load content in using AJAX for performance or live updates, both Drupal and Wordpress can do this natively with a little bit of code to implement routes.
Drupal
Commercial Sponsor/s: Acquia
Website: https://www.drupal.org/
When to use
- Complex multisites that are interrelated
- Larger clients especially government
Tips and tricks
- Import/export your content types, fields, views and site settings in JSON files for easier deployment on multiple environments
- Make use of Panels and Views, but be careful about the database load you create with those configurations.
Wordpress
Commercial Sponsor/s: Automattic
Website: https://wordpress.org/
When to use
- Configurable and scalable for clients of all sizes
- Smaller clients can be setup with simpler off the shelf kits
- Larger clients can be setup with bespoke themes and plugins
Tips and tricks
- Avoid overcomplicating and overengineering things, try to follow the lessons of others who have tried to do the same things you're doing.
- Wordpress is one of the largest ecosystems and so it can be tricky to navigate, here are some resources that will help you build a quality site.
- 10Up Engineering Best Practises for avoiding potential issues with performance and security
- Roots Bedrock for better folder structures
- Roots Sage for a Laravel based theme with Tailwind built-in
Analytics
If you want to know how your websites or web apps are performing, you'll need some kind of monitoring dashboard we typically call "Analytics" software.
You can use free cloud options like Google Analytics and Cloudflare Analytics in a pinch however self hosting has advantages for example you own your data and can do a lot more with it because it's in a database on your system.
Matomo
Commercial Sponsor/s: N/A, community backed open source project
Website: https://matomo.org/
When to use
- There are many websites to manage
- Customisation of interface and reports
Tips and tricks
- Put your logo and customise the skin with your own branding
Monitoring
If you have cloud or on-premises infrastructure chances are you'll have a need to keep an eye on things like CPU usage, memory use and disk space.
Monitoring dashboards like New Relic are handy if you don't have the budget to setup a solution or just need rapid deployment via their CLI tools.
Self hosted monitoring can be very handy when off the shelf solutions are no longer sufficient for the complexity of your operation.
Grafana
Commercial Sponsor/s: N/A, community backed open source project
Website: https://grafana.com/
When to use
- Complex needs such as multiple systems in multiple locations
- Customisation options such as monitoring specific services like Redis
Tips and tricks
- Setting up Prometheus can be a bit daunting and resources heavy, try using InfluxDB if you just have simpler needs
- There's a huge database of user contributed dashboards you can drop into your install with a copy and paste.
Search
When driving search features for large content databases like online stores and news services, you may find the need to switch out the built-in search for something a bit more powerful and configurable.
If you are using a CMS and just need it working immediately, you can use a plugin like ElastiPress and connect to a cloud search engine within minutes.
Elastic Search
Commercial Sponsor/s: Elastic
Website: https://www.elastic.co/
When to use
- Better performance is needed, i.e. WooCommerce product search is unbearably slow
- Customisation is needed to improve quality of search results, i.e. fuzzy word matching for common typos
- Business Intelligence when used as part of the ELK stack
- ELK combines Elastic Search, Logstash for gathering data from server log files and Kibana to provide a visual interface for analysts.
Tips and tricks
- Elastic talks to other systems using simple GET requests via AJAX, making it very easy to talk to using PHP or Javascript code.
- Make sure you appropriately secure your Elastic instance from the web, i.e. don't allow writes from strangers
Virtualisation
The heart of the cloud, virtualisation powers all the cloud giants offerings allowing them to spin up countless virtual machines on demand.
When deploying self hosted applications for production use you'll probably be using a Virtual Private Server (VPS) from Amazon Web Services, Linode, Vultr, Digital Ocean or Microsoft Azure.
Not to be confused with containerisation, self hosted virtualisation means using a physical computer on premise to host virtual machines, or VPS's.
XCP-ng
Commercial Sponsor/s: N/A, community backed open source project
Website: https://xcp-ng.org/
When to use
- On premises testing, development and staging environments
- Recycling old PC's to provide services
Tips and tricks
- Create a base machine with defaults you like, for example latest Ubuntu LTS, your own logins and any configuration you want.
- Create new virtual machines by cloning from this base machine, and also periodically update it with the latest fixes
- There is a free monitoring program for Windows, it's old but very powerful
- The web based monitoring tool is OK, but a bit pushy about paying for a pro version with additional features