.conf

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.

Category
Code and data
MIME type
Type
Plain text
Is a .conf file safe to open? Usually safe to read. A .conf is text, but editing system configuration incorrectly can break services, so back up first and know the software.

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.

How to open 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. For a step-by-step walkthrough, see how to open a .conf file.

Windows

  • Notepad++
  • VS Code
  • any text editor

macOS

  • VS Code
  • nano
  • any text editor

Linux

  • nano
  • vim
  • VS Code

.conf file signature (magic bytes)

Programs recognise a .conf file by the bytes at the start of the file, not by its name. These are the signatures for CONF.

Hex signatureOffsetNote
(no fixed signature)0plain text; no fixed magic bytes

See the full magic-numbers reference for every format.

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: