When you create an application with Google App Engine,
the app is automatically served on the
appspot.com domain at
However, it's often desirable to serve your app at a custom domain that you own (
at specific subdomains of that domain (
or at any or all (
*.example.com) subdomains of that domain.
It's easy to do this with App Engine. First, of course, you must acquire a domain through a domain registrar. Once you have a domain, customizing your app to use your domain or subdomain involves three steps:
- Prove to Google that you control the domain.
- Configure Google servers to recognize the domain.
- Update the DNS records at your domain registrar to point to Google servers.
The entire process can typically be completed in a few minutes at your computer.
Note that the instructions on this page are for App Engine apps that use an ordinary HTTP connection and are not served through Google Apps. Here are some related procedures that require different instructions:
- To serve your App Engine app through Google Apps, read about App Engine in the Google Apps help center.
- To assign an additional domain to your Google Apps services, read about custom domains in the Google Apps help center.
- To add Secure Sockets Layer (SSL) encryption (i.e., an HTTPS address) to your App Engine app, you must use the SSL service provided with Google Apps. You'll find information and instructions at SSL for a Custom Domain.
Serving your app on a custom domain
If you don't already have a domain name, you can create and register a new domain name at Google Domains. You can also use a third-party domain name registrar.
To associate your application with your domain, click the button below.
On the page that follows you'll need to
verify that you are the domain owner.
Then, select the domain you want to use to serve your App Engine app.
Finally, add the provided
CNAME records that are listed in
the Developers Console at your registrar.
Updates to domain records take time to propagate out across the
Internet, and reach different users at different times. The process can take up
to two days, but for most users it is much quicker than that. If you wish to
confirm that the registrar implemented the changes, you can use DNS tools such
Using Strict-Transport-Security headers in a custom domain
You cannot use Strict-Transport-Security headers unless your domain is whitelisted. To place your domain in the whitelist, contact email@example.com..
If you set up a wildcard subdomain mapping for your custom domain, then your application serves requests for any subdomain that matches.
If the user browses a domain that matches an application version name or module name, the application serves that version.
If the user browses a domain that matches a module name, the application serves that module.
For example, suppose you set up a wildcard subdomain
Your application has two versions, the default version and one named
beta, and a module named
be with just one module instance running.
whatever.wild.example.comserves your application.
betaversion of your application.
alpha.beta.wild.example.comalso serves the
betaversion of your application.
0.be.wild.example.comserves the zeroth instance of the
something.0.be.wild.example.comalso serves the zeroth instance of the
1.be.wild.example.comserves an error message, but if the
bemodule was provisioned with more than one instance, then this would serve the first (after zeroth) instance.
You can use wildcards to map subdomains at any level, starting at third-level subdomains. For example, if your domain is
example.com and you enter text in the web address field:
* maps all subdomains of
example.com to your app.
*.private maps all subdomains of
private.example.com to your app.
*.nichol.sharks.nhl maps all subdomains of
nichol.sharks.nhl.example.com to your app.
*.excogitate.system maps all subdomains of
excogitate.system.example.com to your app.
If you use Google Apps with other subdomains on your domain, such as
Note that some DNS providers might not work with wildcard subdomain mapping. In particular, a DNS provider must permit wildcards in CNAME host entries.