Does CouchbaseLiteSwift framework sync gateway works on localhost servers only?

I have given role to the user as “Read-only-admin” .I don’t know how to check pemissions for user “sync_gateway” on the bucket? Please tell me.

That’s insufficient - You need “Application Access”. The installation docs provide step-by-step guidance on how to configure your Couchbase server, Sync Gateway etc

And I want to know how can I use this as online server ? Means when no localhost available & sync gateway is not started , how can I operate the app on mobile device ?There will bel no syncing with server & client

Hmm…did you read the docs or follow any of the tutorials? I would recommend that you start with one of the Getting Started tutorials (Search for “getting started” …)- There is a step-by-step guide on how to deploy app in standalone mode (no sync) and extend it for sync

Again…how can I edit the permissions for user “sync_gateway”? Currently I can not edit anything on the server and when I launch the Couchbase Server , it shows the Admin console login screen.
Even now I can’t create new bucket also in the Couchbase Server .
And as per the document https://docs.couchbase.com/sync-gateway/2.6/getting-started.html#creating-an-rbac-user
why read only admin access is needed to give?

I’d strongly recommend you having a look at the tutorials that were mentioned above, as I presume that the answer to your question lies down there.