---
# System prepended metadata

title: OctoberCMS Setup

---

# OctoberCMS Setup

## Setup and config
* First install composer in your system with(for ArchLinux):
    `pacman -S composer`

* To create a new project with composer, use 
    ```
    composer create-project october/october myoctober
    ```
    this will set the project in myoctober directory

* To load/initiate compsoer in an existing project dorectory use:
`composer install`

* env file has to be generated after this. to do so, use:
`php artisan october:env`

* in case of existing project, copy the content of env file. otherwise create your own by filling database and table informations. 

*Note: More details on installation with composer [here](https://octobercms.com/docs/console/commands#console-install)*

# Database

Access mysql as root:
```
sudo mysql -u root -p
```
*Note: database, username and password should match the value set in .env file.*

Create a new database:
```
CREATE DATABASE database_name;
```

Create new user and grant permission:
```
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';
```

It's not a good idea to grant all right to general users.

To grant permission:
```
GRANT ALL PRIVILEGES ON * . * TO 'eydean_user'@'localhost';

```
*More on users and permissions on [here](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql)*


Then reload all privileges:
```
FLUSH PRIVILEGES;
```

data from an existing database can be imported using the dump file. 
`sudo mysql database_name < dump_file.sql`

after these steps, existing projects can be run by using:
`php artisan serve`
