this post was submitted on 08 Nov 2025
24 points (96.2% liked)

Selfhosted

53652 readers
514 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I am moving my personal web site from netlify to a VPS. It runs via Caddy as just a plain, static web site generated from Hugo. Netlify offered a free contact form, but now I need to provide my own solution, somehow.

I'd like to self-host that too, if possible, on the VPS but then I need to handle spam blocking, form validation, possibly capcha, and sending the outbound email myself - and I don't have experience doing any of that. An AI chatbot suggested a python script using flask but I would still need to do a bunch to make that work, I think.

There are a number of form handling cloud services online (such as staticforms dot xyz) but then the form submissions are going through their servers. My visitors probably wouldn't care, but I would still prefer to self-host something, if it's not too hard to setup.

What do you all recommend? Anyone find a clever solution to this already?

I already have a "comments" feature wired into the site - I could just stick with that but some people seem to still prefer to contact me directly, instead of using that.

EDIT: This is all done - thanks for all the great ideas, you all rock!

top 12 comments
sorted by: hot top controversial new old
[–] rimu@piefed.social 8 points 1 month ago* (last edited 1 month ago) (1 children)

I'm a flask developer but even so I would use PHP for this. There are a million php-based contact form scripts on the web and configuring caddy to use PHP will be easier than python/flask.

As for the sending email part - don't run a smtp server locally, too much hassle. Smtp2go has a free tier which will be fine.

[–] perishthethought@piefed.social 2 points 1 month ago

Oooooh, that smtp2go looks really nice. I am going to put this on my to-do list and check it out soon. Thanks!

[–] adarza@lemmy.ca 3 points 1 month ago (1 children)

the form itself is easy, it's the bot detection and spam prevention that's hard. on my own sites, i've given-in and use the highest-level recaptcha, a hidden form field triggered by bots but not humans, and a server-side script for the mailing that also has some spam detection routines. they still get through, but far less often than a naked form would.

if you're satisfied with your existing comments function, can you simply enable comments on your 'contact' page and hide them from public view?

[–] perishthethought@piefed.social 1 points 1 month ago

if you’re satisfied with your existing comments function, can you simply enable comments on your ‘contact’ page and hide them from public view?

I was also struggling with DNS issues all day so this is what I am putting in place for now. Yah, good enough is good enough. Thanks for the idea.

[–] bobslaede@feddit.dk 3 points 1 month ago

I have used opnform with success. Have tried a bunch others, but this one worked well for me. It sounds like your use case is almost the same as mine.

[–] iii@mander.xyz 3 points 1 month ago (1 children)
[–] perishthethought@piefed.social 1 points 1 month ago

OK, that's amazing but also probably more than I need. My form just has like three fields. But thanks for the idea.

[–] slazer2au@lemmy.world 2 points 1 month ago (1 children)

Wordpress?
Maybe overkill but will allow for anything you want in the future.

[–] perishthethought@piefed.social 2 points 1 month ago

Don't really want to completely re-do my web site, but thanks.

[–] madnificent@lemmy.world 2 points 1 month ago

You could provide a (separate) email address for that and hope spam detection is good enough. You can use <a href="mailto:me@example.com?subject=Direct mail message from PAGE">mail me</a> to have them open their mail client. It is wise to provide the address visually too and you might ask them to include something in the subject so you can filter out mailing list spam easily.

[–] irmadlad@lemmy.world 1 points 1 month ago (1 children)
[–] perishthethought@piefed.social 1 points 1 month ago

Not quite what I need, but thanks