Where is the home directory?

Overview

You will see the terms /home directory, user's home directory, and website directory used very often when reading articles on where to upload and manage your website files. These terms can be confusing since they all point to a different location on the server.

This article explains what these directories are and how to confirm you are in the correct location on the server when managing your website.

Terminology

The following terms are explained in this article:

Term Explanation
User A user/username is the name assigned to a domain on the server.
The server's /home directory Directory where all users are located
User directories Multiple user directories in the /home directory
The user's home directory A single user's directory. (Also referenced by the  ~ symbol)
The website directory Website directory under a single username

User

A website user is the username assigned to your domain name on the server. This is the username used to log into your server with an SFTP or SSH client to manage your website. Multiple websites can be created under a single username. View the following articles for further information about users at DreamHost.

The server's /home directory

The /home directory is the directory on the server where ALL users are located. This is referenced as /home. On the server it would simply look like this:

/home
  • No user at DreamHost has access to this directory.
  • This directory only contains various username directories.
  • These user directories contain websites. 

User directories

The /home directory on the server contains many different usernames. Each username is its own separate directory in the /home directory.

Shared servers

If you are on a Shared web server, the usernames you have created along with any other users on that server are located in this /home directory. For example:

/home
    /youruser1
    /youruser2
/youruser3 /otheruser1 /otheruser2 /otheruser3

VPS or Dedicated servers

If you are on a VPS or Dedicated server, only your personal usernames are located in the /home directory. For example:

/home
    /youruser1
    /youruser2
    /youruser3

The user's home directory

This is the directory referenced throughout this knowledge base when the term user's home directory is mentioned.

This directory is often referenced by the ~ symbol. For example:

[server]$ cd ~

The user's home directory is specific to a single user on the server. It is one of many users listed in the /home directory on the server. For example:

/home/youruser1

Only your user has access to this specific user directory. No one else can access it. This is where all of your website and user configuration files reside.

If you have logged into your server via SSH, you can run the pwd command to view which directory you're currently in. This is how it would appear if you're already in your user's home directory.

[server]$ pwd
/home/username

What is this directory used for?

This directory is most often used to manage your user's configuration files (such as the .bash_profile) and view your access and error logs. If you need to manage your website files, you must navigate into your website directory instead.

Here is how it would look in an SFTP client like Filezilla:

user's home directory

Default files in the user's home directory

These are the default files you'll see in the user's home directory.

/home/youruser1/
               .alias
               .bash_profile
               .bashrc
               .cshrc
               /Maildir
               /logs
               /example.com

The website directory

The website directory is where your actual website files are located. For example:

/home/youruser1/example.com

If you have logged into your server via SSH, you can run the pwd command to view which directory you're currently in. This is how it would appear if you're already in your website directory.

[server]$ pwd
/home/username/example.com

Here is how it would look in an SFTP client like Filezilla. You will see all of your website files listed.

filezilla

Assigning a user to a domain

When you add hosting to a website in the panel, a username is assigned to it. The following articles explain the different ways to add a user to a domain and server.

One user per domain policy

A website can only belong to a single username, but a single user can have multiple websites under it. The following article explains this in more detail.

Summary

When you need to manage your website, you will either be in your user's home directory or website directory.

User's home directory

In this directory you would configure settings for the user as it applies to all websites under it. For example, editing your .bash_profile or customizing your PHP settings in a phprc file.

Website directory

This is the directory where you would edit a specific website's files.

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?