Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed Ubuntu on my personal machine. I've never used Linux before. I installed Ruby, and Ruby on Rails. I'm about to start a new project. Where should I save it?

I tried cd /var then mkdir www and got a permission denied error. So I did sudo mkdir www. But now I am afraid that every time I want to save or create something, whether using Rails console or my text editor, I'm going to get permission errors.

Should I move my project into my home dir?

share|improve this question

Yes You should use Your home folder

for example

mkdir home/YourUserName/Ruby
share|improve this answer
Thanks! But what if I decide to install Apache and start developing in say, PHP. Should my files be in /var/www/ then? – Mohamad Jan 26 '12 at 21:59
Why so? I keep all my work in my home folder. If You want to be an admin, or have a permission to write files in some other place You need to configure users and groups and what they can do with those files. – Misery Jan 26 '12 at 22:14

Add your user to the www-data group.

Then log out and back in.

The set your permissions in /var/www

Files are owned by root:www-data , permissions of 660

Directories are also owned by root:www-data , permissions of 770


On a production server (anything publilc facing), I use the same ownership. Permissions - files 640 directories 750

On a production server I edit everything as root ( sudo -e /var/www/file )

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.