Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
VGSOURCES
Get listed

config.phpPATCH 2026.10.15

How to Update config.php on a Self-Hosted ownCloud Server

By VGSources Team 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use ownCloud’s occ config:system:set command for a single setting whenever possible; it writes the correct PHP value while preserving file ownership. Edit config/config.php manually only when you need a change that the command cannot express. In either case, back up the configuration and database first, make the smallest possible change, validate it as the web-server user, and test the affected feature before declaring the update complete.

What config/config.php does and where to find it

ownCloud uses config/config.php to control server operations. It is part of the ownCloud installation, not a file in a user’s home directory or in the web server’s generic configuration tree. The usual layout has an ownCloud root containing the occ command and a config/ directory:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
owncloud-root/
├── occ
├── config/
│   └── config.php
└── ...

The path above is a layout, not a promise that every deployment uses the same directory. A package, container image, distribution integration, or administrator-created installation can place the root elsewhere. Locate the directory that contains both occ and config/config.php before running any command. If you are unsure which copy is active, inspect the service definition, virtual-host document root, package documentation, or the running container rather than editing a similarly named file.

The file contains a PHP array named $CONFIG. It can hold URL and host restrictions, storage paths, database connection information, caching choices, mail settings, logging options, and other system-level values. App-specific preferences are stored separately, so changing a value in config.php is not a substitute for an app’s own configuration command.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Back up before changing production settings

A configuration typo can prevent PHP from loading ownCloud, while an incorrect database or storage value can make an otherwise healthy installation unusable. Treat every production edit as a change that must be reversible. The ownCloud upgrade procedure requires backups of both ownCloud and its server database before maintenance; the same discipline applies to a configuration update.

Create a timestamped configuration copy

From the ownCloud root, copy the current configuration to a location readable by the administrator but outside the web root. A root shell can use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo cp -a config/config.php /root/owncloud-config.php.$(date +%Y%m%d-%H%M%S)

Keep the backup’s restrictive permissions. Do not place it in a publicly served directory, a shared ticket attachment, or a repository that contains credentials. If your deployment uses additional .config.php files, include those files in the backup as well.

Back up the database with its vendor-supported tool

Use the backup method documented for the database engine and deployment. The backup must be restorable, not merely an export whose success was assumed from a zero-length file. Record where the dump is stored, protect it like the configuration because it may contain personal data and credentials, and retain at least one copy outside the server or web root. A removable or external drive can be useful for an offline copy, provided it is encrypted and access-controlled.

Record the intended change

Write down the key, old value (without copying secrets into a ticket), new value, operator, and time. This makes a later rollback and audit possible. Never paste passwords, encryption material, database credentials, or a complete private configuration into shell history, chat, issue trackers, or support requests.

Inspect the current system configuration safely

Run occ from the ownCloud root as the account used by the web server. On many Linux installations that account is www-data, but packaged systems may use another account. The account matters because ownCloud must be able to read and write its files with the same ownership and permissions used by web requests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd /path/to/your/owncloud
sudo -u www-data ./occ config:list -- system

Replace www-data with the actual HTTP user and change the directory to your installation root. The config:list -- system command lists system values while omitting sensitive values by default. Avoid --private unless the output is being handled as secret material in a controlled session; it can expose credentials and other confidential settings.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Save the non-sensitive output if you need a before-and-after comparison. For a single change, note the exact key and its current type. A value that looks like the string 1 is not interchangeable with the integer 1, the Boolean true, or a JSON array.

Preferred method: change one value with occ

For an individual system parameter, use the documented command family:

sudo -u www-data ./occ config:system:set <parameter> --value='<value>'

The command writes the system setting to config.php and preserves the expected ownership when run as the HTTP user. Replace the angle-bracketed items with the real parameter and value; do not type the brackets themselves.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the correct type

String values need no type flag. For non-string values, specify the type supported by your ownCloud version:

sudo -u www-data ./occ config:system:set some_flag --value='true' --type=boolean
sudo -u www-data ./occ config:system:set some_limit --value='20' --type=integer
sudo -u www-data ./occ config:system:set some_ratio --value='0.5' --type=double
sudo -u www-data ./occ config:system:set some_structure --value='{"mode":"strict"}' --type=json

These examples show the command form. Use the type expected by the setting’s documentation. A JSON value must be valid JSON, including double-quoted property names; shell quoting protects the JSON from being interpreted by the shell. For secrets, avoid putting the literal value in a command that will be retained in shell history. Use a protected administrative session and clear or disable history according to your operating policy.

Example: add a trusted domain

Trusted domains restrict the hostnames through which users may access the instance. If you need to add a hostname, first inspect the existing indexed entries, then set the next unused index rather than overwriting an existing one:

sudo -u www-data ./occ config:list -- system
sudo -u www-data ./occ config:system:set trusted_domains 1 --value='cloud.example.org'

The index shown here is illustrative: use the next available numeric key in your installation. Keep the hostname exactly as users will enter it, without a URL scheme or path. After the change, test a sign-in through that hostname. A trusted-domain update does not by itself create DNS records, obtain a certificate, configure a reverse proxy, or make an unencrypted hostname safe for production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Understand system settings versus app settings

The config:system:set family is for values written to the system configuration. App settings use a different storage path and command family. If a setting belongs to an app, follow that app’s administration documentation instead of forcing an entry into config.php; an apparently successful system entry may simply be ignored.

Manual editing of config/config.php

Direct editing is appropriate when the required change is not represented cleanly by occ ext{ }config:system:set, when you are adding a carefully reviewed custom block, or when your deployment process manages the file as code. It is universal but syntax-sensitive.

Preserve the existing PHP structure

Open the file with a root-capable editor:

sudoedit /path/to/your/owncloud/config/config.php

Keep the opening <?php tag and the existing $CONFIG = array ( structure intact. Add or change only the parameter you intend to modify. Follow the surrounding style and include a trailing comma where the array syntax requires one. A minimal entry looks like this:

$CONFIG = array (
  // existing entries remain here
  'trusted_domains' => array (
    0 => 'localhost',
    1 => 'cloud.example.org',
  ),
);

Do not paste the entire config.sample.php into the live file. The sample contains defaults and documentation for many options, not a replacement for the values already tailored to your server. Enter only the parameters you wish to modify, and leave unspecified settings at ownCloud’s supported defaults.

Validate PHP syntax before restarting services

Use the PHP command-line interpreter’s syntax-check mode when it is available:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
php -l /path/to/your/owncloud/config/config.php

A successful check reports no syntax errors. It does not prove that a path exists, a database is reachable, a hostname resolves, or a value is valid for ownCloud. Those checks happen during the verification stage. If the syntax check fails, restore the backup or fix the smallest possible punctuation error before reloading PHP or the web server.

Preserve ownership and permissions

Editing as root can leave the file owned by root or with modes that prevent the web-server process from reading it. Compare ownership and permissions with the backup and neighboring configuration files, then restore the ownership expected by your installation. Do not make the file world-writable as a shortcut; that exposes credentials and allows unauthorized changes.

Use additional .config.php files when isolation helps

ownCloud permits additional files ending in .config.php in the config/ directory. A narrowly named file can isolate a logically separate custom block, such as locally managed reverse-proxy values, from the main file. This can make code review, deployment, and rollback easier.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Apply the same PHP syntax, ownership, permissions, and backup rules as for config.php. Do not define the same key in several files unless you understand how your ownCloud version loads and resolves those values; duplicate definitions make troubleshooting and rollback ambiguous. Keep one authoritative location for each setting whenever practical.

Docker, containers, and packaged installations

Container images and distribution packages often change both the path and the execution context. Do not assume that /var/www/owncloud, www-data, or a host-mounted config/config.php is correct for your deployment.

Run the command in the environment that owns the installation

For a container, enter the running container or use the image’s documented command wrapper, then run the equivalent of:

sudo -u www-data ./occ config:list -- system
sudo -u www-data ./occ config:system:set trusted_domains 1 --value='cloud.example.org'

The user, working directory, and command name may differ inside the image. Confirm them with the image documentation and the process definition. If the container uses a non-root service account, run occ as that account rather than changing file ownership from the host without understanding the volume mapping.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change deployment variables in the deployment definition

Some images expose supported settings through environment variables. When an environment variable is the documented source of a value, change the compose file, Kubernetes manifest, systemd unit, or other deployment definition and recreate the container. Editing an ephemeral layer inside a running container can disappear at the next replacement and may be overwritten by the startup process.

Back up persistent volumes, not just the container

Identify where the configuration and database volumes persist. Back up those volumes and the database using the database vendor’s tool. A container image can be recreated; a lost persistent volume or database cannot be recovered from the image alone.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the update in three stages

Do not treat a command that returned without an error as proof that the service is correctly configured.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

1. Read the resulting value

sudo -u www-data ./occ config:list -- system

Confirm that the changed key has the intended value and type. Compare it with the before-change record, while keeping sensitive values redacted. If the key is absent or unchanged, stop and investigate the installation path, HTTP user, parameter name, and deployment overrides.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Exercise the affected feature

Use the actual workflow that depends on the setting. For a trusted-domain change, open the intended hostname and complete a sign-in. For a storage or URL change, test the relevant file operation and a browser request through the real proxy path. For a mail or background-job setting, send a controlled test or observe the next scheduled job without exposing user data.

3. Review logs and background jobs

Watch the ownCloud log and the web-server and PHP logs for parse errors, permission failures, rejected hosts, connection failures, or unexpected redirects. Confirm that background jobs continue to run. A setting can appear correct in config:list while a service account, reverse proxy, DNS record, or database connection prevents the feature from working.

Rollback and recovery

If ownCloud still responds but the feature is wrong

Use occ to restore the previous value when you recorded it, or restore the known-good configuration copy. Re-run the inspection command and repeat the feature test. Keep the database backup unchanged unless the configuration change also altered data and you have a separate, documented reason to restore the database.

If PHP reports a parse error or the site is unavailable

  1. Stop making additional edits and preserve the error message from the web-server or PHP log.
  2. Restore the timestamped config.php backup with the correct ownership and permissions.
  3. Run php -l against the restored file.
  4. Reload or restart only the service required by your deployment, then test the site.
  5. Reattempt the change with occ or a smaller manual edit after identifying the original mistake.

If restoring the configuration does not recover the service, check whether the change also affected a deployment variable, mounted volume, reverse proxy, DNS record, or database. Do not overwrite a working database with an older dump merely because a configuration edit failed; database restoration can discard legitimate activity made after the backup.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choosing between occ, direct editing, and a separate file

Method Syntax risk Auditability and repeatability Typed or JSON values Containers and automation Rollback
occ config:system:set Lower for supported keys because ownCloud writes the PHP representation Commands can be logged in a change record, but protect secret arguments Explicit Boolean, integer, double, and JSON types are available Works when invoked inside the correct container or package environment Reverse the key or restore the configuration backup
Manual config.php edit Higher; PHP punctuation and quoting must be valid Easy to review in version-controlled deployment workflows if secrets are excluded Any representable PHP value, subject to ownCloud’s accepted format Works everywhere the file is accessible, but paths and volume mounts vary Restore the file copy, then correct ownership
Separate .config.php file Same PHP risks as a manual edit Isolates a custom block and can simplify review Any representable PHP value, subject to load-order and duplicate-key rules Useful when a deployment mounts a dedicated configuration fragment Remove or restore that fragment while preserving the main file

Choose the first method for ordinary, supported system keys. Choose direct editing only when it gives you a real capability or deployment benefit, and use a separate file when isolation outweighs the extra responsibility of tracking multiple configuration sources.

A practical change checklist

  • Locate the active ownCloud root containing occ and config/config.php.
  • Back up the configuration, any additional .config.php files, and the database.
  • Store at least one backup outside the web root and restrict access to it.
  • Identify the actual HTTP or container service account.
  • Inspect values with sudo -u www-data ./occ config:list -- system, omitting --private unless secrets are protected.
  • Prefer config:system:set for one supported system value and specify its non-string type.
  • If editing by hand, change only the required entry, preserve PHP array syntax, and do not paste the sample configuration.
  • Run php -l after a manual edit.
  • Re-read the setting, exercise the affected feature, and inspect ownCloud, PHP, and web-server logs.
  • If the service fails, restore the known-good configuration, repair ownership, and retry with the smallest possible change.

Final guidance

The safest repeatable pattern is: back up the configuration and database, inspect with occ, set one supported value as the HTTP user, verify the result, test the user-facing behavior, and retain a tested rollback. Manual PHP editing remains useful, but it should be treated as a controlled exception rather than the default way to change an ownCloud server.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

config.phpDockerLinux administrationoccownCloudself-hosting

Leave a reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.