How do you use Fly.io (Best Hosting for wasp) for free?

OpenSaas team suggested me fly.io, I have successfuly deployed service to their server, but with out a trafic, it costs me 0.83 dollar, while it was active for the weekend. I remember that fly.io fast free? How to use it for free?
No description
35 Replies
kapa.ai
kapa.aiā€¢5mo ago
Hi @skyblade2954. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Fly.io does offer free services that are perfect for deploying your first Wasp app. However, to use Fly.io's free allowances for up to 3 VMs, you need to add your credit card information before you can proceed. If you don't, the deployment will fail. You can add the required credit card information on the account's billing page (https://fly.io/dashboard/personal/billing) [^1^]. Also, you need to have the flyctl CLI (https://fly.io/docs/hands-on/install-flyctl/) installed on your machine before you can deploy to Fly.io [^1^]. Make sure you are logged in with flyctl CLI. You can check if you are logged in with flyctl auth whoami, and if you are not, you can log in with flyctl auth login [^1^]. To deploy your app, you can use the Wasp CLI which deploys the server, deploys the client, and sets up a database. It also gives you a way to redeploy (update) your app with a single command [^1^]. If you want to deploy manually, you can follow the steps provided in the Wasp documentation [^2^][^3^][^4^][^5^]. Please note that while Fly.io does offer free services, certain usage may incur costs. It's recommended to review Fly.io's pricing details (https://fly.io/docs/about/pricing/#plans) to understand what is covered under the free tier and what is not. ^1^]: [Source (https://wasp-lang.dev/docs/advanced/deployment/cli) ^2^]: [Source (https://wasp-lang.dev/docs/advanced/deployment/manually#flyio-server-and-database) ^3^]: [Source (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-flyio-app) ^4^]: [Source (https://wasp-lang.dev/docs/advanced/deployment/manually#set-up-a-flyio-app) ^5^]: [Source (https://wasp-lang.dev/docs/advanced/deployment/cli#deploying) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @skyblade2954, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
mihoā€¢5mo ago
As per this response: https://community.fly.io/t/free-tier-is-dead/20651/15 If you spend less than 5$ in any given month, they waive the bill meaning it's free.
Fly.io
Free tier is dead?
Default (ā€œpersonalā€) PAYG orgs will have invoices <$5 waived. The choice to switch is up to you, weā€™re not forcing anyone off of their plan and, if you have a certain level of usage, the Hobby plan might be more affordable than PAYG (because of the inclusion of free allowances on Hobby).
skyblade2954
skyblade2954OPā€¢5mo ago
Fly.io
Free tier is dead?
I just uploaded a small wasp project for testing. It didnā€™t got any traffic, and cost me 0.83 dollars just in 3 days. How this is possible.
skyblade2954
skyblade2954OPā€¢5mo ago
I asked in that chat too. It is really strange, that my project has couple of pages, really small and it got no traffic in last 3 days, and it cost me 0.83 dollars, with that it is impossible to make the project under 5 dollars in 1 month.
miho
mihoā€¢5mo ago
I guess Fly's new pricing makes it hard to be under 5$. Is it possible in theory? Railway has the same deal, under 5$ of usage gets waived: https://railway.app/pricing
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
miho
mihoā€¢5mo ago
And I'm running an app there for 0$
No description
skyblade2954
skyblade2954OPā€¢5mo ago
So railway is better. :/
skyblade2954
skyblade2954OPā€¢5mo ago
Fly.io
Impossible to use fly.io for free.
I built an app, wasp/react project which has couple of small sized pages. I upload my project successfully for testing 3 days ago. It didnā€™t got any traffic, however it cost me 0.83 dollars, just staying activeā€¦ Nearly 1 dollar in 3-4 days. There is no way it cost less than 5 dollars in 1 month (free allowance). So it is nearly imposible to use...
skyblade2954
skyblade2954OPā€¢5mo ago
Here I created a post we will see if they are going to reply or not. So you are using railway for free? Can I see your webpage links?
skyblade2954
skyblade2954OPā€¢5mo ago
wow nice it cost nothing really? Ok I will use railway. Did it got any traffic?
miho
mihoā€¢5mo ago
It's not really popular šŸ˜„ so, not really, but it should be fine with some traffic
skyblade2954
skyblade2954OPā€¢5mo ago
I think I am using it wrong. I have two toml files server and client both have 1GB memory so probably that is the problem. I should lower my memory settings I believe. Why do I have a server and a client? Also I changed my db to postgre, it was required for build, It also cost some money? How much ram is good for my product? for example 10k a month views for a website, 256 mb ram is enough I believe?
IamIconLiving
IamIconLivingā€¢5mo ago
-- It is really strange, that my project has couple of pages, really small and it got no traffic in last 3 days well maybe yes, maybe no. wasp isn't just a static html page with couple of pages wasp gives you a backend that has to constantly run somewhere, using memory you can check if your fly services have "always on", which means they always run. if you remove this options, you will save your resources and money when nobody is using the project, but this however means that on first connection this will take some time to "wake up" the project (couple of seconds, we are not talking about minutes here)
neogeofun
neogeofunā€¢5mo ago
Any free service will have limits, and it will generally be the lowest offering. 1GB memory is steep and well above the lower limits of what you can purchase on any hosting service. If no one uses your application, reduce it to the lowest possible. Even 128MB would be able to comfortably handle 10K views per month.
skyblade2954
skyblade2954OPā€¢5mo ago
My wasp project creates client, server, and db. What are those? I didn't make any database request in my code, those it mean, I can disable it, in fly io apps? What is client, server and db when I run "wasp deploy fly launch mycoolapp mad" Why Client, Server and db created?
IamIconLiving
IamIconLivingā€¢5mo ago
you can see what wasp produces
No description
IamIconLiving
IamIconLivingā€¢5mo ago
when you launch an application, you can also see in your logs: client, server
No description
IamIconLiving
IamIconLivingā€¢5mo ago
here is your frontend on localhost:3000 and here is your server on localhost:3001
No description
IamIconLiving
IamIconLivingā€¢5mo ago
and it is being done by a basic wasp new template, without any features or other boilerplates so as you can see wasp produces a backend and a frontend, even if you don't need the backend therefore you cannot deploy the wasp apps on platforms like Firebase hosting, for example. Services that are designed for static page hosting so your fly.io instance always serves a backend + client wasp is not a static page generator wasp saves you from writing the same boilerplate code over and over (setting up authentication, backend, routes etc)
IamIconLiving
IamIconLivingā€¢5mo ago
when you use wasp, you can see what it produces as output by checking .wasp folder don't modify it if you don't know what you are doing but you can see that you are getting backend code with a frontend code as a result of wasp run
No description
skyblade2954
skyblade2954OPā€¢5mo ago
I will give 128 or 256 Mb of ram memory to db client and server .toml files for fly.io Hopefully that would be enough My app creates client, server and db, with all those apps, do you think it is still possible to use fly.io for free? I plan to give 256 Mb in toml file.
IamIconLiving
IamIconLivingā€¢5mo ago
Itā€™s really hard to estimate, I have no idea, and I donā€™t know if anybody will give you more estimate You can try estimating this with chat gpt I donā€™t think itā€™s good enough to run on 256mb but dunno for sure
skyblade2954
skyblade2954OPā€¢5mo ago
You don't use fly.io then? You use Railway?
miho
mihoā€¢5mo ago
Thank you @IamIconLiving šŸŒ¶ for explaining this well!
IamIconLiving
IamIconLivingā€¢5mo ago
I used both in the past, I donā€™t have anything deployed there for a while tho, I am a lazy bum who doesnā€™t have side projects
skyblade2954
skyblade2954OPā€¢5mo ago
Guys one last thing. https://wasp-lang.dev/docs/advanced/deployment/cli I am following this guide but, I am not sure how I can set the memory configuration with the : asp deploy fly launch my-wasp-app mia command
Deploying with the Wasp CLI | Wasp
Wasp CLI can deploy your full-stack application with only a single command.
skyblade2954
skyblade2954OPā€¢5mo ago
When I run this command it deploys my project, and creates toml files. but default value is 1gb, how can I change it to 256? or some other value
IamIconLiving
IamIconLivingā€¢5mo ago
That would be more appropriate to search on fly.io resources For example https://community.fly.io/t/set-default-machine-memory-for-apps-during-creation/14019/10
Fly.io
Set default machine memory for apps during creation
fly launch creates and deploys a new app that you manage with our Fly Launch features (like a fly.toml file for config and deploying with fly deploy and scaling with fly scale). Since you run fly create and then fly deploy I guess you have a fly.toml config file that you reuse for each new app? Assuming you actually want to create a brand new ...
skyblade2954
skyblade2954OPā€¢5mo ago
wasp deploy fly setup <app-name> <region> wasp deploy fly create-db <region> wasp deploy fly deploy I am going to try these commands and after the first one try to change the toml files
IamIconLiving
IamIconLivingā€¢5mo ago
if my memory doesn't fail me, everything that comes after wasp deploy fly is actual fly-existing commands. Wasp is proxying those commands, so any Fly.io CLI commands can be used with different flags, wasp will "forward" them that's why it might be a good idea to search for fly.io documentation on available configuration options but Wasp team hopefully will correct me if I am wrong about commands
skyblade2954
skyblade2954OPā€¢5mo ago
flyctl scale vm shared-cpu-1x --memory=256 -a mycoolapp-client flyctl scale vm shared-cpu-1x --memory=256 -a mycoolapp-server Or this one probably works
martinsos
martinsosā€¢5mo ago
Just to mention: Wasp is still in Beta so our focus hasn't been on optimizing the resource usage. In the future we will put more work into being able to deploy a Wasp app that spends as little as possible, but we are not there yet.
skyblade2954
skyblade2954OPā€¢5mo ago
@martinsos Yes, but small warnings would be good.
MEE6
MEE6ā€¢5mo ago
Wohooo @skyblade2954, you just became a Waspeteer level 7!
Want results from more Discord servers?
Add your server