The mishna says that sanhedrin applies both in E.Y. and Chutz La'aretz. The gemara says that the source of this din is the pasuk - והיו אלה לכם לחוקת משפט לדורותיכם בכל מושבתיכם, meaning that we have batei dinim בכל מושבתיכם even in chutz la'aretz. But the pasuk by appointing judges implies that it is only a requirement in eretz yisroel - שופטים ושטרים תתן לך בכל שעריך אשר ה' אלקיך נותן לכך לשבטך, implies only in the land that Hashem gave over to the shevatim? The gemara answers that in E.Y. there are batei dinim in each "p'lach" (province) and each "ir" (city), but in chutz la'aretz there are only batei dinim in each province, not in each city.
The Rambam (Sanhedrin 1:1) writes that there is a mitzvas aseh from the torah to appoint judges in every medina and p'lach. He then qualifies this (halacha 2) - the halacha to set up batei dinim in every p'lach and every ir, is only in E.Y. but in C.L. (chutz la'aretz) -אבל בחוצה לארץ אינן חייבין להעמיד בית דין בכל פלך ופלך . The kesef mishna struggles with the Rambam and says that if he had the same girsa in the gemara as we do, then rather than saying you don't have to set up courts in every p'lach, you would have to add the word "אלא בכל פלך ופלך".
However, the Lechem Mishna points out that the Ramban (Parshas Shoftim) seems to understand from the Rambam that there is no mitzvah to set up batei dinim in chutz la'aretz. The Ramban quotes the Rambam to hold - וביאר בכאן שישימו השופטים בכל עריהם כאשר יתן להם וכו' כי בחוצה לארץ אינם חייבים למנות להם בית דין אבל כאשר יצעק המעוות יעמדו עליו הראויים לשפוט וכו' או יעלה לארץ בזמנה ושם ישפטוהו וכו' ולפי"ז אין ישראל שבחוצה לארץ מצווים למנות להם דיינין בעיירות וכ"כ הרב רבינו משה
The Ramban seems to have understood from the Rambam that in chutz la'aretz there is no chiyuv to set up batei dinim in every p'lach, and certainly there is no need to set up in every city. Meaning, the Rambam holds that in chutz la'aretz there is no need to set up batei dinim at all. The Ramban proceeds to ask on the Rambam from our gemara which clearly holds that there is a mitzvah to set up sanhedrin in chutz la'aretz, just that it is sufficient to be in every province, not every city.
It seems that the Ramban already realized the answer to his question when he presented the opinion of the Rambam. The mitzvah to set up courts only applies in E.Y. The pasuk in parshas mas'ei mentions that there will be courts בכל מושבתיכם, but doesn't command this as a mitzvah. The Ramban holds that according to Rambam, for practical purposes it would be necessary to have courts even in C.L. but it would not be a mitzvas a'seh. This is meduyak in the mishna. It doesn't say that there is a mitzvah to set up courts, rather that the Sanhedrin is "noheges" in E.Y. and C.L. Both the Rambam and Ramban agree that it is necessary to have courts in chutz la'aretz, but the Ramban considers this part of the mitzvas a'seh, whereas the Rambam doesn't.
Another point is that the Ramban (Shoftim) writes that this mitzvah no longer applies since we no longer have semicha - כיון שכל המשפטים בטלים מן התורה וכו' ואנן הדיוטות אנן וכו' אין אנו חייבים במצות מינוי השופטים מן התורה כלל. Clearly, the Ramban holds that this mitzvah only applies when it is possible to appoint those with se'micha, but afterward there is no mitzvah. The Ramban in Parshas Ma'sei quotes from the gemara that after the destruction of the beis hamikdash there is no longer a Sanhedrin in E.Y. or C.L. But, the Ramban asks that the language of לדורותיכם בכל מושבותיכם certainly implies that there should be batei dinim after the churban of the beis hamikdash? The Ramban answers that the ability to judge capital cases was lost with the destruction of the beis hamikdash, but there is still a mitzvah to set up courts to judge penalty cases, monetary issues and give malkus even after the churban. That is why the torah uses the language of לדורותיכם בכל מושבותיכם, to teach that even after dinei nefashos can no longer be judged, there must still be courts set up to judge the other things. The Ramban seems to hold that the mitzvah of setting up judges applies literally לדורותיכם בכל מושבותיכם, in all generations. Even after the churban there is a mitzvah of שופטים ושוטרים תתן לך, a mitzvah aseh to set up courts to judge whatever can be judged. However, once we lost the mesorah of semicha and were no longer able to set up "judges" (only "hedyotos"), the mitzvah becomes impossible to fulfill. The Ramban holds that the mitzvah is completely no'heig l'doros, just that it is impossible to fulfill when there are no se'muchin. The Ramban doesn't mean to say that we aren't technically chayev in the mitzvah nowadays, he just means to say that we aren't practically chayev since we don't have semuchin to appoint.
The difficulty with the Ramban is that since there is a mitzvah d'oraysa to set up courts both in E.Y. and C.L. and in all generations, why is there a difference between E.Y. and C.L. regarding batei dinim in each city? The Ramban (shoftim) writes that the idea of batei dinim in each city and each province is to create a system of lower and higher courts, so that the beis din of the province can override the local beis din. Perhaps the Ramban understands that the mitzvah of setting up courts in chutz la'aretz is to make sure that each locale has the courts that it needs to judge and maintain justice. In chutz la'aretz it is purely a practical requirement to make sure that there are enough courts to judge the people. However, in E.Y. the responsibility is to set up a court SYSTEM for the purpose of being able to ensure a ושפטו את העם משפט צדק - the ability to differ to a higher court and ensure that "mishpat tzedek" is being achieved.