Each site created in Locomotive has a generic address based on its
For instance, sites hosted by locomotive.works, our platform for professionals, will have the following address:
If you've deployed your own Locomotive application with mylocomotiveapp.com as your main domain, you will end up with addresses like this one:
Locomotive gives you the ability to map any domain names you want to your site so that you don't have to give
https://station.locomotive.works/_app/my-site/preview anymore as the address of your site.
Installing Locomotive Engine on your local machine and binding to your own custom domain name
If you are looking for information on how to bind a locally installed Locomotive Engine to your machine, please scroll down to 4. below
Let's say you want
example.com to point your Locomotive site hosted by locomotive.works.
In order to manage to map a domain, you need to have access to the DNS manager of the domain name you previously purchased.
You need to create a record for the
www sub domain. This can be done by logging into the administration panel of your DNS manager for your example.com domain name. Here are the information you'll need.
If you host your own Locomotive application, use the address of your platform as the "Alias for".
For a root domain name (ex.: example.com), you can't use a CNAME record. You need to create A record instead. Again, in your DNS manager for your domain name, add a new A record with the following information:
|Name||(leave it blank)|
188.8.131.52 is the IP address of the locomotive.works platform.
If you host your own Locomotive application, use the IP of your platform as the "Address".
DNS modifications can take time to be fully effective.
More explanation here
Now, go to the back-office of your Locomotive site and click to the
General Settings section in the left sidebar.
Add your 2 domains (www.example.com and example.com). You should end up with the following screen. Do not forget to save your modifications.
So, now, if you type
www.example.com in your browser, you will see the index page of your Locomotive site.
The following instruction will describe how to use the feature described under 3. Add your domains to the back-office above on a Locomotive Engine installed on a local machine.
We assume that:
- you have a Locomotive Engine up and running, installed as described here;
- you are logged in on the command line as an adminsitrator;
- you are using a Mac;
- you known - or at least, you think you know what you are doing.
On the command line:, do
Enter your username and password as requested.
First, make a backup copy of your /etc/hosts file. Something like:
$ cp /etc/hosts /etc/hosts.20151201
$ vi /etc/hosts
You are now in the /etc/hosts file. With the scrolling arrows, go to the line following the line:
Type i (to enter into vi's edit mode). You can now add some text to your file.
Press return to add a new line.
Add the following lines:
127.0.0.1 locomotive.dev 127.0.0.1 alpha.locomotive.dev
Press the ESC button, then type ZZ. This should save your file and close vi automatically.
Now, if the rails server where your Locomotive Engine is running, close it and restart with the following command.
Do not forget to log out of your
sudo account before starting the rails server!
$ bundle exec rails s -b 0.0.0.0
This will bind rails to listen on all your localhosts.
If you follow the instructions in 3. Add your domains in the back-office and add
to your list of domain names, you should be able to visit your local site with your browser at:
Updated about 4 years ago