Question

How to change dokku domain

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

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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

Submit an Answer