What is a .conf file?
Configuration File · Code and data · Various · n/a
A .conf file holds configuration, most often for Unix and Linux software such as web servers and system daemons. It is usually plain text with settings, comments and sometimes nested blocks.
What is a .conf file used for?
The .conf extension is common in the Unix world: nginx.conf, httpd.conf, sshd_config and many others. Each program defines its own syntax, but they are text files edited with any editor.
Lines beginning with # are usually comments. A single wrong directive can stop a service starting, so administrators test configuration and keep backups before applying changes.
What opens a .conf file?
The .conf format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- Notepad++
- VS Code
- any text editor
macOS
- VS Code
- nano
- any text editor
Linux
- nano
- vim
- VS Code
Open a .conf file step by step
- Confirm the file really is a .conf. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with Notepad++ or VS Code.
- On Mac, use VS Code or nano.
- On Linux, try nano or vim.
- Still stuck? Search for a dedicated CONF viewer rather than a generic one.
Why can't I open my .conf file?
Almost always because no installed app understands CONF. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .conf at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
CONF has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.
Frequently asked questions
What is a .conf file?
A .conf file holds configuration, most often for Unix and Linux software such as web servers and system daemons. It is usually plain text with settings, comments and sometimes nested blocks.
How do I open a .conf file?
Any text editor opens it. On Linux, editing usually needs administrator rights (sudo) because config files live in protected system folders.
What program uses .conf files?
Many, especially Unix and Linux software: web servers (nginx, Apache), SSH, and system services each have their own .conf with their own syntax.
I edited a .conf and the service broke, why?
One invalid directive can stop a service loading. Restore your backup, and use the program's config-test command (for example nginx -t) before restarting.
Related formats
Sources
Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.