Trouble Previewing Forms in ODK Central on Ubuntu Server 22.04: 'Could Not Connect with Form Server' Error

1. What is the issue? Please be detailed.
I successfully installed a self-hosted ODK Central on an Ubuntu Server 22.04 within my local network, and everything seems to be working fine overall. However, I'm encountering an issue where I cannot preview forms in either the web browser or ODK Collect. Whenever I try to preview a form in the web browser, it returns the error message "Could not connect with Form Server."

2. What steps can we take to reproduce this issue?

3. What have you tried to fix the issue?

4. Upload any forms or screenshots you can share publicly below.

//.env

# Use fully qualified domain names. Set to DOMAIN=local if SSL_TYPE=selfsign.
#DOMAIN=your.domain.com
DOMAIN=localhost

# Used for Let's Encrypt expiration emails and Enketo technical support emails
SYSADMIN_EMAIL=administrator@email.com

# Options: letsencrypt, customssl, upstream, selfsign
#SSL_TYPE=letsencrypt
SSL_TYPE=selfsign

# Do not change if using SSL_TYPE=letsencrypt
HTTP_PORT=80
HTTPS_PORT=443

# Optional: configure Node
# SERVICE_NODE_OPTIONS=

# Optional: connect to a custom database server
# DB_HOST=
# DB_USER=
# DB_PASSWORD=
# DB_NAME=

# Optional: configure a custom mail server
# EMAIL_FROM=
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_SECURE=
# EMAIL_IGNORE_TLS=
# EMAIL_USER=
# EMAIL_PASSWORD=

# Optional: configure Single Sign-on with OpenID Connect
# OIDC_ENABLED=
# OIDC_ISSUER_URL=
# OIDC_CLIENT_ID=
# OIDC_CLIENT_SECRET=

# Optional: configure error reporting
# SENTRY_ORG_SUBDOMAIN=
# SENTRY_KEY=
# SENTRY_PROJECT=

# Optional: configure S3-compatible storage for binary files
# S3_SERVER=
# S3_ACCESS_KEY=
# S3_SECRET_KEY=
# S3_BUCKET_NAME=

Welcome to the forum @kibrom.mahari! When you have a chance, we encourage you to introduce yourself and your project to help build community and add context around your needs. Adding a profile image also helps build community. It also looks like you may have created a second account - @Kibrom_Mahari ?

I see you have set DOMAIN to localhost, please see this post:

Greetings! I apologize for not introducing myself earlier—my name is Kibrom Mahari, and I am currently working on a project aimed at collecting information about farmers in Ethiopia. As I mentioned previously, I have successfully installed ODK Central on my local machine and set the domain to localhost. While I have been able to create various projects and upload forms to my Central instance, I am encountering an issue where I am unable to preview the forms I have uploaded for my projects. I would greatly appreciate any guidance or troubleshooting steps to resolve this issue and ensure that I can preview and test my forms effectively. Thank you in advance for your assistance!

As noted at https://docs.getodk.org/central-install/#self-hosting, to self-host Central and have everything work properly, you must have a fully qualified domain name (e.g., central.example.com) mapped to your server. For security reasons, Central will not work with localhost or just an IP address (e.g., 93.184.216.34).

Hey @kibrom.mahari ! :waving_hand:

If you're looking to deploy ODK Central locally and still be able to access it from anywhere in the world, I'd suggest checking out the method I shared - "here" - it might be a good starting point.

However, if you're planning to use it for production or handling any critical data, I strongly recommend going with a more trusted tunneling service - like Cloudflare - rather than something like Telebit (which I mentioned in the topic).

Even better, for a fully private and robust setup, you can look into using FRP. You can actually deploy FRP for free on Oracle’s free-tier .. ! It’s a really solid option if you're aiming for long-term and private use.

Just a few things to note:

  1. If you’re just experimenting and want to explore what ODK Central can do by deploying it locally, feel free to follow the topic I shared - it should work just fine for testing purposes.
  2. The most trusted, robust, and private solution in my opinion is using FRP. (I like Cloudflare too, but I always keep skepticism about their intentions).
  3. I wouldn't recommend using a locally tunneled setup for production and mission-critical data collection - there are just too many variables like internet stability, latency, and the risk of an improper deployment shutdown causing bigger issues down the line.

Hope this helps! Have a great day! :smile:

1 Like