You’d have to use the machine’s public IP, and disable CloudFlare’s proxy while setting up HTTPS in AMP (otherwise certbot will fail). More info on that here:
https://discourse.cubecoders.com/t/setting-up-secure-http-https-with-amp/2305
For your Minecraft issue, from the lack of info I’d assume you’re using Spigot if you’re talking about “compiling” minecraft, as that’s the only server type with a build step.
If that is the case I’d suggest using Paper, as it supports more plugins, it’s more performant, and doesn’t have the build step.