Fly.io for self hosting CouchDB #85
Replies: 14 comments 24 replies
-
TLDR: it works perfectly! I signed up with a free fly.io trial account, which is more limited than the hobby plan but you don't need to add payment method, they were good with the hobby plan and now even more generous with the free trial plan! I spun up a couchdb instance and attached 1gb volume to it, then replicating my self-hosted couchdb to this fly.io instance as a backup, it works perfectly. Now I have my self-hosted couchdb replicating to cloudant, fly.io and one other self-hosted one, enough for data security I suppose. |
Beta Was this translation helpful? Give feedback.
-
Can confirm this works perfectly; and both of the free plans on fly.io (that is, with/without a payment method added) should be sufficient for 100% uptime. For peace of mind I generated a virtual card number, but it's probably not necessary. |
Beta Was this translation helpful? Give feedback.
-
This might help others who stumble across this. For me to get CouchDB to work on Fly.io with PouchDB connections, I had to make sure my ports looks like this
|
Beta Was this translation helpful? Give feedback.
-
I followed the process above using $ flyctl deploy
==> Verifying app config
--> Verified app config
==> Building image
Searching for image 'couchdb:latest' remotely...
image found: img_r7hjdjeb9adhfjf
==> Creating release
Error We need your payment information to continue! Add a credit card or buy credit: https://fly.io/dashboard/someusername/billing
My fly.toml: [build]
image = "couchdb:latest"
[env]
COUCHDB_USER = "someusername"
[mounts]
source="couchdata"
destination="/opt/couchdb/data"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
|
Beta Was this translation helpful? Give feedback.
-
I found that all steps can be run from the Google Colaboratory. We do not have to instal the client locally. https://gist.github.com/vrtmrz/6715f01bf038c9f66e9d2768c3fdee36 SECURITY WARNING |
Beta Was this translation helpful? Give feedback.
-
looks like credit card is necessary (location india) |
Beta Was this translation helpful? Give feedback.
-
does this plugin sync other plugins 2 way street too? |
Beta Was this translation helpful? Give feedback.
-
thank you so much for this! in my opinion this is the best option if you want to use livesync for free, even if it still requires a credit/debit card, since every free option do need a credit or debit card anyway. the registration process is super easy and it's not as fussy about card details and personal information as ibm cloudant, my debit card work perfectly on this! (my attempt at ibm lead to my account getting banned without even doing anything...) and the hobby plan on fly.io seems to be really good, 3 gb maximum, dozens of gigabytes of maximum outbound transfer per month, i don't think even big obsidian vaults will exceed the free plan. plus the setup is pretty simple, especially with the google collab deployment you made. before this i tried using google cloud since it accepts way more cards than any other platforms, but it's 100 times more complicated, and the "free" plan are not really free, usually it's a couple of cents per month but it keeps growing bigger and bigger as the vault gets bigger (from my understanding google's free outbound transfer is only a gigabyte per month). and the documentation on google about the free plan is not as clear cut which can be really confusing sometimes... and the billing is all over the place, sometimes the bill goes to a negative amount which is very concerning HAHAHA. but with fly.io the cost stays 0 as long as you don't exceed the outbound transfer (which is again very unlikely), the vm selection is very simple, so is the persistent volume storage. so once again, thank you so much for sharing it! |
Beta Was this translation helpful? Give feedback.
-
the first step gives me this error Has anyone has the same issue? |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say thank you! Fly.io works perfect with zero issues (couldn't create an account on IBM although using gmail or corporate email address with real physical credit cards and uk address - ended up having banned account for no reason!) Hands down, LiveSync is the best plugin for Obsidian so far - and probably one of the most underrated plugins! Thank you again. |
Beta Was this translation helpful? Give feedback.
-
I deployed couchdb on flyio with docker by following this post. But it always requires me to click the fix button in livesync ‘cause it always auto turn off the CORS setting and restore /opt/couchdb/etc/ocal.ini on couchdb . |
Beta Was this translation helpful? Give feedback.
-
I've put together a Google Colaboratory version that has persistent configurations in https://gist.github.com/aparaschiv/d878e6aa886d21a41ca1a9794707f61f Feel free to adapt it to your own needs. |
Beta Was this translation helpful? Give feedback.
-
It took me 3 days to configure it, but I am enormously grateful. |
Beta Was this translation helpful? Give feedback.
-
FYI I had the issue that my fly.io machine ran out of memory all the time during the initial sync ( In case the same happens to others, I did the following things which then ended up successfully syncing my complete vault
|
Beta Was this translation helpful? Give feedback.
-
Hi, everyone.
I heard that somebody get troubled with making account of IBM Couldant. So I looked around for alternatives, but there are not, unfortunately.
Therefore, perhaps we have to serve CouchDB ourselves. But setting up the server is a little complicated and dangerous.
I found this: fly.io.
I still don't understand how it will costI used it a day, it looks like it is almost free when using as like using IBM Couldant. (Pricing).Does somebody know this?
I registered and set it up to try it out. I felt this is so awesome.
The only thing I worried about is how it costs. But it might be ok.
EDITED
I wrote a Colab note for making a CouchDB instance with some configuration on fly.io. This includes several patches for fly.io v2. If you do not remember enabling the swap, possibly you should create the instance again.
FYI, the setup procedure is below:
or
Wizard will be launched, answer as you like
(This means make 2 GB data volume in the Tokyo region, you have to adjust region you selected)
If you get CouchDB's information, It's ok.
Open /_utils, Set up CouchDB (Just hit
Configure a Single Node
)https://xxxxxx-yyyyyyy-0000.fly.dev/_utils/#/setup
If you have been asked username and password, use COUCHDB_USER and COUCHDB_PASSWORD.
Set up Self-hosted LiveSync
Hit the
Check database configuration
button and EveryFix
button.Hit the
Test database connection
button.If you get
Connected to ...
, it works!If you are worried about how it will cost too. be sure to stop the app. (We can run it again with count 1.)
If you tried, let me know how it is.
Beta Was this translation helpful? Give feedback.
All reactions