If you have a paid account on PythonAnywhere, you can set up websites on a
custom domain -- that is, a domain that is not your-username
There are three steps
- (if you haven't already), purchase a domain name from a domain name registrar.
- Create a new entry on the Web tab for your new domain
- Create a CNAME record with your domain provider, pointing at the new website
There are two optional, but recommended steps, to make your site secure. Do these after you've done the steps above:
Purchasing a domain name
We don't recommend any particular domain registrar, they're all pretty similar. Just google around, compare prices (they should all be very similar), and pick the one that seems to have the friendliest user interface.
Creating a PythonAnywhere website for your new domain
For best performance and reliability on PythonAnywhere, we strongly recommend that you use a CNAME to point your domain at our servers. Without going too much into the technical details, a CNAME means that you don't need to do any DNS configuration beyond the initial setup; we can manage everything for you, so if (for example) the IP address associated with your website gets blocked in some country, or if it's subjected to a denial-of-service attack, we can move your website over to a different IP address without you needing to do anything.
The one restriction that CNAMEs have is that they cannot be used for "naked" or "apex"
domains. To make that more concrete, you can use
somethingelse.yourdomain.com for the website, but not
But that doesn't have to be a problem; you can host your site on
and then set things up so that people who visit
yourdomain.com are automatically
www.yourdomain.com. There's more information on that last bit later on.
Given all that, here's how to create the website:
If you don't have a website for it yet
Just click the "Add a new web app" button on the Web tab. In the first step,
it will ask you for the domain name to use. You should specify the
fully-qualified domain name -- that is,
www.yourdomain.com, not just
domain.com. Next go on to choose your Python version, framework and so on.
If you already have a website that you want to use
This help page explains how to use a new domain for existing website,
for example if the site you want to show is currently displayed at
jane.pythonanywhere.com, and you want it to appear at
Once again, you should specify the
fully-qualified domain name -- that is,
www.yourdomain.com rather than
Configuring the domain at the domain registrar
Once you've purchased your domain and created the new website config on PythonAnywhere, you'll want to find the configuration screen on your domain provider that allows you to set up a CNAME record.
The CNAME record will point
www.yourdomain.com to the value specified on
the "Web" tab for your application; this value will be of the form
XXXX is some number or other.
Setting up this kind of record tells the domain name system
that when someone asks for your website, they should get it from one of the servers
that make up PythonAnywhere.
Note: your website itself will not show up at the
address. It's just an identifier for a server.
CNAME records have two parts. The Alias and the Canonical Name. The alias
in this case should be
www. The address should be the value from the "Web"
tab -- the one like
Different DNS providers call them different things.
- Alias: domain name, Alias name, or just "name"
- Canonical Name: the address, FQDN, Fully Qualified Domain Name, or Host Name.
If you're using OVH as your registrar, you may also see that they've automatically
created a TXT record for
www.yourdomain.com with a value of
you'll need to delete that, as a domain can't have both a TXT record and a CNAME.
Notes for specific DNS providers
Here's how to set up a CNAME for some popular registrars:
Testing your configuration
CNAME changes can take a little while to propagate from your registrar to the rest of the Internet. You can see whether the change has reached PythonAnywhere yet by looking at the site on the "Web" page; it will show a warning if the CNAME it sees for your domain is not the one it expects.
You can also use this CNAME lookup tool if you
want to get a second opinion: Enter your website's name (including the
prefix) and select "CNAME" from the dropdown. It will check the CNAME from a
bunch of different places around the Internet, which will give you a feel for
how far the propagation has got.
If your CNAME is still not working after a couple of hours, you should double-check your setup. If you can't work out what is wrong, email us at firstname.lastname@example.org, including a screenshot of the settings as you have configured them on your registrar's DNS setup page.
Recommended: set up HTTPS for a secure site.
There are two steps to do for this:
Optional: Set up a naked domain redirect
Most people want their site set up so that when someone goes to
http://yourdomain.com/ they are redirected to
or if they go to
http://yourdomain.com/foo they are redirected to
http://www.yourdomain.com/foo, and so on.
The easiest way to do this is normally to set it up with your domain provider; almost all of them provide it as a free service. Here are the links for some popular registrars:
If you are using a different registrar, searching for "forward naked domain" plus the name of your registrar will probably find the appropriate help page.
If your registrar doesn't support domain redirects, we know of two alternatives, both free: