Kikobeats
By:
Kikobeats

How to change dokku domain

June 23, 2015 3.5k views
Configuration Management DNS Nginx Linux Commands Ubuntu

I feel happy with my Droplet with Ubuntu + Dokku. However, In the installation I used a domain and I want to change for another.

It is possible without make a fresh install? I put much effort in setup databases in services :'(

2 comments
  • Yeah its possible.Ive done it a number of times.There are two modes

    1.server side(ssh session to your droplet)
    simply run the command

        dokku domains:set appname mydomain.com  *.mydomain.com
    

    where appname is your dokku app name,mydomain is the name of your domain.it does not necessarily have to be .com .
    once you run that it should release the application and deploy it again

    2.client(side)
    i'm assuming you deploy your application from your machine using "git dokku push master" command.if so then you should change the git remote of your machine
    use

        git remote -v   //to check your remotes
    

    if one exists then you can remove it using

       git remote rm remotename   //remote name is the one shown on source and destination
    

    finally to change the domain name run the following command

       git remote add dokku dokku@yourdomain:yourappname
    

    i hope this helps someone :)

  • I don't know if this has been changed recently but using dokku 0.4.14 the command is dokku domains:add appname yourdomain.com

1 Answer

This question was answered by @maikofelix89:

Yeah its possible.Ive done it a number of times.There are two modes

1.server side(ssh session to your droplet)
simply run the command

   dokku domains:set appname mydomain.com  *.mydomain.com

where appname is your dokku app name,mydomain is the name of your domain.it does not necessarily have to be .com .
once you run that it should release the application and deploy it again

2.client(side)
i'm assuming you deploy your application from your machine using "git dokku push master" command.if so then you should change the git remote of your machine
use

   git remote -v   //to check your remotes

if one exists then you can remove it using

  git remote rm remotename   //remote name is the one shown on source and destination

finally to change the domain name run the following command

  git remote add dokku dokku@yourdomain:yourappname

i hope this helps someone :)

View the original comment

Have another answer? Share your knowledge.