-
Sign up and log in to Fly
flyctl auth signup
-
Setup Fly. It might ask if you want to deploy, say no since you haven't built the app yet.
flyctl launch
-
Important: Fly is going to do an
npm install
when you deploy your app. This template assumes you have your Remix token available as an environment variable namedREMIX_TOKEN
for both npm installs on your computer and on Fly's servers. Open up your terminal rc file and add this:# .zshrc, .profile, .bash_rc, etc. export REMIX_TOKEN="your token here"
After you've done that, either open a new terminal tab or run
source ~/.zshrc
(or whatever your rc file is) to get the new env var available in your shell. Now you can run a localnpm install
.npm i
-
Lastly, you'll need to tell Fly about your token as well:
flyctl secrets set REMIX_TOKEN=${REMIX_TOKEN}
You can use this for other secrets too, like stripe tokens and database urls.
From your terminal:
npm run dev
This starts your app in development mode, rebuilding assets on file changes.
If you've followed the setup instructions already, especially the REMIX_TOKEN environment variable step, all you need to do is run this:
npm run deploy
You can run flyctl info
to get the url and ip address of your server.
Check out the fly docs for more information.