# How do I deploy my Rails project?

https://www.seturack.com/en/knowledgebase/article/how-do-i-deploy-my-rails-project

1. In the panel, open **My servers** and click your server.
2. On the **Overview** tab, wait for the **App** row to say "Ruby on Rails is ready". The page refreshes itself.
3. Open the link in the **Site address** row. The sample page shows the Rails version.

## Working on the project

[Connect over SSH](https://www.seturack.com/en/knowledgebase/article/how-to-connect-with-ssh) and switch to the project user:

`su - app`

`cd ~/uygulama`

`set -a; . /etc/seturack-rails.env; set +a`

`export PATH=$GEM_HOME/bin:$PATH`

After that, `bundle install`, `bin/rails db:migrate` and `bin/rails assets:precompile` work. When your code changes, run `systemctl restart uygulama` as root.

## Good to know

- The database is SQLite and lives in the `storage` folder. If you want PostgreSQL or MariaDB, install it with `apt` and change `config/database.yml`.
- Puma listens on port **3000** only inside the server.

## Your own domain

1. Point your domain's A record to your server's IP address.
2. As root, replace the old name everywhere: `sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile`. `OLD_NAME` is the part after `https://` in the address shown in the panel.
3. Run `systemctl reload caddy`.

Caddy gets and renews the certificate by itself.

Only **80**, **443** and **22** for SSH are open to the outside.

**No server yet?** [Order a server with Ruby on Rails installed](https://www.seturack.com/en/rails-vps): you choose the size and pay for what you choose.
