# Installing Ember.js on managed hosting accounts

> Install Node.js, npm and Ember.js on your hosting account and create your first Ember.js single-page application.

Source: https://helpcenter.ruachost.com/developers/web-development/installing-ember-js-on-managed-hosting-accounts/

Learn how to install Ember.js on a managed hosting account. This client-side JavaScript framework is used to create single-page applications.

Ember.js is based on the model-view-controller (MVC) architecture and provides features such as automatic template updates, application state management, and more.

### Step 1: Install Node.js and npm

Ember.js requires Node.js, so the first step is to install Node.js and npm (Node.js package manager) on your account. Follow the instructions in this article for step-by-step guidance.

### Step 2: Install Ember.js

After installing Node.js, you can install Ember.js:

1. Log in to your account using SSH.
2. Run the following commands:

```
mkdir ~/lib
cd ~/lib
npm install ember-cli
```

3. Create a symbolic link to run Ember from any directory:

```
cd ~/bin
ln -s ../lib/node_modules/ember-cli/bin/ember ember
```

4. Verify the installation:

```
ember --version
```

This displays the Ember version installed.

**Tip:** To view Ember's online help:

```
ember help
```

### Step 3: Create an Ember.js application

1. Create a new Ember application:

```
cd ~
ember new testProject
```

This creates an Ember application named `testProject`.

2. Start the Ember application (choose a port between 49152 and 65535):

```
cd ~/testProject
JOBS=1 nohup ember server --port xxxxx &
```

- The `&` runs the command in the background.
- `nohup` ensures the application continues running even after logging out.

3. Configure your web server:

```
cd ~/public_html
```

Create or edit an `.htaccess` file with:

```
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:xxxxx/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:xxxxx/$1 [P,L]
```

Replace `xxxxx` with the port number used in the previous step.

4. Open your website in a browser. You should see the "Welcome to Ember" page.

**Tip:** If the application fails to start, the chosen port may be in use. Check `nohup.out` for errors, select another port, update the `.htaccess` file, and restart.

5. To stop Ember:

```
pkill ember
```

This stops all running Node.js applications immediately.

### Troubleshooting Ember.js pages

Because Ember.js runs in the browser, you can use developer tools to troubleshoot:

- **Firefox:** Tools → Web Developer → Web Console
- **Chrome:** Settings → Tools → JavaScript Console
- **Internet Explorer:** Settings → F12 Developer Tools → Script tab

### More information

- Official Ember.js site: [http://emberjs.com](http://emberjs.com/)
- Official Ember.js documentation: <http://emberjs.com/guides>
