Chmod 644 for Web Files

Learn how chmod 644 is the standard for web content files. Owner read-write, world-readable. Essential for serving static content.

Permission

644

rw-r--r--

chmod 644 filename

Permission Breakdown

RoleRead (4)Write (2)Execute (1)OctalMeaning
Ownerrw-6read, write
Groupr--4read
Othersr--4read

Visual Permission Grid

Read
Write
Execute
Owner
r
w
-
Group
r
-
-
Others
r
-
-

Detailed Explanation

The permission 644 is the universal standard for static web content files served by web servers like Apache and Nginx.

Octal breakdown:

  • 6 (Owner): read (4) + write (2) = read and write
  • 4 (Group): read (4) only
  • 4 (Others): read (4) only

In symbolic notation this is rw-r--r--.

Web servers typically run as a dedicated user (like www-data or nginx) that is different from the file owner. The web server process needs read access to serve files to visitors. Permission 644 ensures:

  1. The developer/owner can edit files directly
  2. The web server can read and serve the files
  3. Nobody except the owner can modify the files
  4. The files are not executable (an important security measure)

Files that should use 644 include HTML documents, CSS stylesheets, JavaScript files, images (JPEG, PNG, SVG, WebP), font files, XML files, JSON data files, and any other static content. PHP files are an exception in some configurations: if PHP runs as CGI, PHP files might need execute permission (755), but with PHP-FPM (the modern standard), 644 is correct.

Use Case

The required permission for all static web content: HTML, CSS, JavaScript, images, fonts, and documents served by Apache, Nginx, or any standard web server.

Try It — Interactive Calculator

Customize this permission →