Where config files live: nginx, Apache, MySQL, PostgreSQL, Redis and PHP on every OS

By the Zofle team · 6 November 2026 · 3 min read

The same program keeps its settings in different places on each system, and there is often more than one copy: one that came with the OS, one from a package manager, and one from an old install. Before you edit or delete anything, ask the program which file it actually reads. The command is in the last column.

Configuration files

ProgramUbuntu / DebianRHEL / Fedora / RockymacOS (Homebrew, Apple silicon)WindowsAsk the program
nginx/etc/nginx/nginx.conf, sites-available/, sites-enabled/, conf.d//etc/nginx/nginx.conf, conf.d//opt/homebrew/etc/nginx/nginx.conf (Intel: /usr/local/etc/nginx)conf\nginx.conf inside the unzipped foldernginx -t prints the file; nginx -T prints everything it loads
Apache/etc/apache2/apache2.conf, sites-enabled/, mods-enabled//etc/httpd/conf/httpd.conf, conf.d//opt/homebrew/etc/httpd/httpd.confXAMPP: C:\xampp\apache\conf\httpd.confapachectl -V or httpd -V (SERVER_CONFIG_FILE)
MySQL / MariaDB/etc/mysql/my.cnf plus conf.d/ and mysql.conf.d//etc/my.cnf, /etc/my.cnf.d//opt/homebrew/etc/my.cnfC:\ProgramData\MySQL\MySQL Server 8.0\my.inimysqld --verbose --help | grep -A1 "Default options"
PostgreSQL/etc/postgresql/<ver>/main/postgresql.conf/var/lib/pgsql/<ver>/data/postgresql.conf/opt/homebrew/var/postgresql@<ver>/postgresql.confC:\Program Files\PostgreSQL\<ver>\data\postgresql.confpsql -c "SHOW config_file;"
Redis/etc/redis/redis.conf/etc/redis/redis.conf (older: /etc/redis.conf)/opt/homebrew/etc/redis.confNot officially supported; use WSL or Memurairedis-cli CONFIG GET dir
PHP/etc/php/<ver>/fpm/php.ini and cli/php.ini/etc/php.ini, /etc/php.d//opt/homebrew/etc/php/<ver>/php.iniWhere you installed PHP, php.iniphp --ini
SSH server/etc/ssh/sshd_config/etc/ssh/sshd_config/etc/ssh/sshd_configC:\ProgramData\ssh\sshd_configsshd -T (as root)
hosts file/etc/hosts/etc/hosts/etc/hostsC:\Windows\System32\drivers\etc\hosts-

Data and log folders (where the space goes)

ProgramDataLogs
nginx(no data; site root is whatever you set, often /var/www)/var/log/nginx/; Homebrew /opt/homebrew/var/log/nginx/
Apachesite root, often /var/www/html or /var/wwwDebian /var/log/apache2/; RHEL /var/log/httpd/
MySQL/var/lib/mysql; Windows C:\ProgramData\MySQL\MySQL Server 8.0\Data; Homebrew /opt/homebrew/var/mysqlDebian /var/log/mysql/; binary logs live in the data folder and can grow large
PostgreSQLDebian /var/lib/postgresql/<ver>/main; RHEL /var/lib/pgsql/<ver>/dataDebian /var/log/postgresql/
Redis/var/lib/redis (dump.rdb, append-only file)/var/log/redis/

Leftovers when you uninstall

Removing the package normally keeps your config and data on purpose. On Ubuntu, apt remove keeps /etc files; apt purge removes them, but never the database folders in /var/lib. On macOS, brew uninstall leaves /opt/homebrew/var data. If you are done with a database, export what you need first, then delete the data folder yourself. See what uninstalled apps leave behind.

Where Zofle fits. Zofle is a free disk cleanup and file finder for Mac and Windows. It shows what is filling a disk, folder by folder, lists developer caches, old build folders and leftovers with their size and date, lets you untick what you want to keep, and sends the rest to the Trash or Recycle Bin first so you can undo it.

Sources and method

  • Official documentation: nginx (nginx.org), Apache HTTP Server (httpd.apache.org), MySQL Reference Manual (option files), PostgreSQL documentation (file locations), Redis documentation, PHP manual (configuration file).
  • Homebrew documentation for the Apple silicon prefix /opt/homebrew.
  • Paths and commands are from each tool's own documentation and can differ by version; run the 'find it' command on your own machine before deleting anything.

Zofle Pro news

People signing up now will get Zofle Pro, with more features, for free when we launch it.

One email when it's ready. No spam, ever.