Manual Deploy
Last updated
Last updated
Open your production env file with amber encrypt
then edit the database URL, and disable or enable logs. Also see .
If you have assets and you're using NPM, use npm install . && npm run release
to compile/minify .css
and .js
files.
Installcrystal
and shards
commands (). You can compile bin/amber
tool using shards build amber
in your production project to migrate your database.
Then copy your project repository and ensure to setup AMBER_ENCRYPTION_KEY
and AMBER_ENV=production
in your environments variables. You can get your encryption key from .encryption_key
file in your development machine. Then inside your project's folder, install your shards dependencies with shards install --production
and compile your executable with shards build <your-app> --release
.
Finally run your project executable with bin/<your-app>
.
Compilation may take a while because --release
enables compiler optimizations. You can avoid --release
if you server is low end (less 256 RAM)
Amber performance is still acceptable on non-release mode
You may need sudo permission if you're using port 80 or ports < 1000
You can use iptables
to redirect port 80 to 8080 or whatever port are you using in production.
Optionally you can setup a system service to monitor your app very easy, and configure a .git/hook/post-receive
to deploy like Heroku using git push production
. Amber Team is already using a to manage and thepost-receive
hook below to manage deployment using git.
Then add your production repository to your development machine using git remote add
<user>
is a valid user with your public ssh key inside ~/.ssh/authorized_keys
<ip>
is your production machine IP (you can use a domain as well).
<repository>
is your project with your.git
folder inside.