# Install and update farmOS on shared hosting

**URL:** <https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215>\
**Category:** Hosting farmOS\
**Created:** [January 25, 2025, 3:46am UTC](https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215 "2025-01-25T03:46:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [January 25, 2025, 3:46am UTC](https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215/1 "2025-01-25T03:46:20Z")

</div>

Constraints in shared hosting:  
**a). Infrastructure:**  
1. Can switch between available php versions(most famous versons available)  
2. Mostly mariadb or mysql will be there  
3. Mostly apache2(webserver) will be there.  
4. ssh and ftp will be there  
5. Terminal via web (some time not)  
6. Linux OS  
7. Cpanel  
**b). Access permission:**  
1. Not be a super user.  
2. Only we can write on public\_htm folder (or web directoey)  
3. Have not access for apache configuration (apache2.conf or httpd.conf).  
4. Can be install ssl via cpanel.  
5. In the Most of the hosting we can create database via cpanel only. User can’t adjust the chareset and collate during database creation.  
6. User can’t chage main domain `DocumentRoot` on apache or cpanel.  
7. Some times php extension can install or enable via cpanel.

**warning:** i think farmos not officially support for shared hosting it well tested on Docker.

---

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [January 25, 2025, 4:08am UTC](https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215/2 "2025-01-25T04:08:43Z")

</div>

**Constraints in Drupal:** [official requirements](https://www.drupal.org/docs/getting-started/system-requirements)  
First refer that official requirement page.

1. For install and update farmOS we need composer command should be executable.
2. User can run drush in drush/drush folder (Not possible to set system environment variable.)
3. if we need more translation we should go for utf8mb4 based collation.
4. farmOS `Documentroot` must be `/serverdirectories/farmos/web/` in apache.

**aware:** This is based on my current knowledge.

---

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [January 25, 2025, 4:44am UTC](https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215/3 "2025-01-25T04:44:02Z")

</div>

To install and update farmOS:(via composer)

1. Install required php extensions. (sodium extension not listed).
2. If you said private folder to with in site folder it make better.

**All other details in [https://farmos.org/hosting/composer/](https://farmos.org/hosting/composer/) this page.**

1. Most case some other services routed or redirected via main domain alias like [example.com/cpanel](http://example.com/cpanel) or [example.com/mail](http://example.com/mail). so, You may set farmOS as a alias of main domain like [example.com/farm](http://example.com/farm) .
2. But you need to write apache rewrite condition on public\_html folder for main domain. if it’s subdomain you can set `/serverdirectories/farmos/web/` as `Documentroot` via Cpanel.

```auto
#/public_html/.htaccess file
RewriteEngine On

# Allow access to existing files and directories in the root directory
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Redirect all other requests to farmOS/web
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/farmOS/web/
RewriteRule ^(.*)$ /farmOS/web/$1 [L]

```

1. open url in browser to set final settings and install require farmOS official modules.
2. Before updating take backup code and db. Also check if any new php extension need or not. Then proceed update descriped by [farmOS](https://farmos.org/hosting/composer/) guide.

**aware:** This is based on my current knowledge.

---

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [January 25, 2025, 5:12am UTC](https://farmos.discourse.group/t/install-and-update-farmos-on-shared-hosting/2215/4 "2025-01-25T05:12:14Z")

</div>

**To install and update farmOS:** (via packaged release : officially deprecate in farmOS version 4)

1. Download and extract farmos pacage from [https://github.com/farmOS/farmOS/releases](https://github.com/farmOS/farmOS/releases) this page.
2. Set private folder within site directory in `farmos/web/sites/default/setting.php` file. (user may be copy `farmos/web/sites/default/default.setting.php` to `farmos/web/sites/default/setting.php`)
3. Set apache configuration and open url in browser to set final settings and install require farmOS official modules.  
**Update:**
4. Before updating take backup code and db. Also check if any new php extension need or not.
5. Then download and extract new package from github page.
6. After replace new site folder to older (using farmOS) folder.
7. Run `drush cr` command.
8. open [http://domain/update.php](http://domain/update.php) in browser to complete update.

**aware:** This is based on my current knowledge.
