Need help with kstars?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

132 Stars 72 Forks Other 12.2K Commits 0 Opened issues


Desktop Planetarium

Services available


Need anything else?

Contributors list

A Desktop Planetarium for KDE

KStars is free, open source, cross-platform Astronomy Software.

It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time. The display includes up to 100 million stars, 13,000 deep-sky objects,all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites.

For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations. For the amateur astronomer, it provides an observation planner, a sky calendar tool, and an FOV editor to calculate field of view of equipment and display them. Find out interesting objects in the "What's up Tonight" tool, plot altitude vs. time graphs for any object, print high-quality sky charts, and gain access to lots of information and resources to help you explore the universe!

Included with KStars is Ekos astrophotography suite, a complete astrophotography solution that can control all INDI devices including numerous telescopes, CCDs, DSLRs, focusers, filters, and a lot more. Ekos supports highly accurate tracking using online and offline astrometry solver, autofocus and autoguiding capabilities, and capture of single or multiple images using the powerful built in sequence manager.


Copyright (c) 2001 - 2020 by The KStars Team:

KStars is Free Software, released under the GNU Public License. See COPYING for GPL license information.


KStars is available for Windows, MacOS, and Linux. You can download the latest version from KStars official website.

On Linux, it is available for most Linux distributions.

Latest stable version is v3.4.2

Important URLs and files.

KStars documentation

The KStars handbook can be found in your $(KDEDIR)/share/doc/HTML//kstars/ directory. You can also easily access it from the Help menu, or by pressing the [F1] key, or by visiting Unfortunately, it's a bit out-of-date. We welcome volunteers to help update it.

In addition, there are the following README files:

README: This file; general information README.planetmath: Explanation of algorithms used to compute planet positions README.customize: Advanced customization options README.images: Copyright information for images used in KStars. README.i18n: Instructions for translators


Code can be cloned, viewed and merge requests can be made via the KStars repository. If you are new to remote git repositories, please see the Git Tips section below. Note: Previously KStars used Phabricator for its merge requests. That system is no longer in use.

Integrated Development Environment IDE

If you plan to develop KStars, it is highly recommended to utilize an IDE. You can use any IDE of your choice, but QtCreator( or KDevelop( are recommended as they are more suited for Qt/KDE development.

To open KStars in QtCreator, select the CMakeLists.txt file in the KStars source folder and then configure the build location and type.


  1. Prerequisite Packages

To build and develop KStars, several packages may be required from your distribution. Here's a list.

  • Required dependencies

    • GNU Make, GCC -- Essential tools for building
    • cmake -- buildsystem used by KDE
    • Qt Library > 5.9.0
    • Several KDE Frameworks: KConfig, KDocTools, KGuiAddons, KWidgetsAddons, KNewStuff, KI18n, KInit, KIO, KXmlGui, KPlotting, KIconThemes
    • eigen -- linear algebra library
    • zlib -- compression library
    • StellarSolver -- see
  • Optional dependencies

    • libcfitsio -- FITS library
    • libindi -- Instrument Neutral Distributed Interface, for controlling equipment.
    • xplanet
    • libraw
    • wcslib
    • libgsl
    • qtkeychain
  1. Installing Prerequisites


The apt-add-respository command is needed for the apt-get's libstellarsolver-dev. Alternatively, you can skip the apt-add-repository, remove the libstellarsolver-dev from the apt-get, and build & install stellarsolver from

sudo apt-add-repository ppa:mutlaqja/ppa
sudo apt-get -y install build-essential cmake git libstellarsolver-dev libeigen3-dev libcfitsio-dev zlib1g-dev libindi-dev extra-cmake-modules libkf5plotting-dev libqt5svg5-dev libkf5xmlgui-dev libkf5kio-dev kinit-dev libkf5newstuff-dev kdoctools-dev libkf5notifications-dev qtdeclarative5-dev libkf5crash-dev gettext libnova-dev libgsl-dev libraw-dev libkf5notifyconfig-dev wcslib-dev libqt5websockets5-dev xplanet xplanet-images qt5keychain-dev libsecret-1-dev breeze-icon-theme


yum install cfitsio-devel eigen3-devel stellarsolver-devel cmake extra-cmake-modules.noarch kf5-kconfig-devel kf5-kdbusaddons-devel kf5-kdoctools-devel kf5-kguiaddons-devel kf5-ki18n-devel kf5-kiconthemes-devel kf5-kinit-devel kf5-kio-devel kf5-kjobwidgets-devel kf5-knewstuff-devel kf5-kplotting-devel kf5-ktexteditor-devel kf5-kwidgetsaddons-devel kf5-kwindowsystem-devel kf5-kxmlgui-devel libindi-devel libindi-static qt5-qtdeclarative-devel qt5-qtmultimedia-devel qt5-qtsvg-devel wcslib-devel xplanet zlib-devel
  1. Compiling

Open a console and run in the following commands:

mkdir -p ~/Projects
git clone
mkdir -p kstars-build
cd kstars-build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ../kstars
make -j8
sudo make install

To run KStars, simply type kstars in the terminal.

Code Style

KStars uses Artistic Style to format all the C++ source files. Please make sure to apply the following astyle rules to any code that is submitted to INDI. On Linux, you can create ~/.astylerc file containing the following rules:

Some IDEs (e.g. QtCreator) support automatic formatting for the code every time you save the file to disk.

Making Updates to the Handbook

On linux run the following to install the necessary programs:

sudo apt-get install docbook docbook-utils

The source for the handbook is in kstars/doc. You can edit those files, include them in commits and MRs like you would c++ files (see below). You could figure out the markup by example, or learn from online doc for docbook. In general, it is best to first copy the entire kstars/doc directory to a temporary directory, and edit and generate the handbook there, because if you ran meinproc in the main source directory, you would generate many .html files there, and you don't want to commit the generated files to your git repository.

cp -pr kstars/doc ~/DOCBOOK
meinproc5 index.docbook

The above should generate html files. Then, in a browser, you can simply open DOCBOOK/index.html and navigate your way to the part you want, e.g. just type something similar to this in the url bar of chrome: file:///home/YOURUSERNAME/DOCBOOK/doc/tool-ekos.html Make changes to some of the .docbook files in ~/DOCBOOK/*.docbook. Regenerate the html files, and view your changes in the browser, as before. Iterate.

To check syntax, you might want to run:

checkXML5 index.docbook

Once you're happy, copy your modified files back to kstars/doc, and treat the edited/new files as usual with git, including your modified files in a new commit and eventually a new merge request.

Merge Request Descriptions

See the section below, Git Tips, on technical specifics of how to generate a Merge Request. In the process of making the request, you will need to describe the request. Please use a format similar to this one which has sections for a summary of what was done, what was modified in each file, other relevant notes, and how to test your changes.

Git Tips

You must be familiar with git to make changes to KStars, and this is not the place for such a tutorial. There are many excellent resources for that on the web. The paragraph below, though, will give an overview of one way to make a Merge Request, given you already have sufficient git experience to clone KStars, make a local branch, modify the code as you like, commit your changes to your local branch, and test your code thoroughly.

Here's one good resource for a fork-branch-git-workflow to make KStars changes. The steps below are inspired by that page.

One-time KStars git environment setup.

  • Make your KDE identity
  • Login. Go to the KStars gitlab page and login in the upper right corner.
  • Fork the project. Then, still on the KStars gitlab page, Click FORK in the upper right hand corner, to create your own fork of the project.
  • Copy your URL. Note the url of your fork. It should be
  • Clone KStars. Back on your computer run these commands
    • mkdir -p ~/Projects
    • cd ~/Projects
    • git clone
    • cd kstars
  • Add your upstream. Add the KStars main repo to your forked repo.
    • git remote add upstream

You are set up now.

Steps used for each change. After the one-time setup (above), the steps below could be used for each new feature submission. In summary, you will make a feature branch in your local repository, make your desired changes there and test, push them to your fork, create a request to merge your fork with the main KStars repo, wait for feedback, and possibly iterate on your changes hoping for approval from an authority.

  • Create your feature branch.
    • git checkout -b YOURBRANCHNAME
  • Make your changes
  • Commit your changes
    • git commit -a
  • Push changes to your forked repo.
    • git push origin YOURBRANCHNAME
  • Create a Merge Request
    • Use your browser to visit your forked repo at
    • You should see an option to create a Merge Request for YOURBRANCHNAME. Fill in the details (see the above section).
    • You should be able to see a new URL dedicated to that Merge Request.
  • Make Some Changes. You may get requests to modify some of your code.
    • If so, you simply go back to your local branch, make and test your changes.
    • Commit your changes as above, inside your branch, with: git commit -a
    • Push your branch's changes to your forked repo as above with: git push origin YOURBRANCHNAME
    • Your changes should automatically be added to your Merge Request. Check the Merge Request's page to be sure.
    • You may need to rebase your code--see below for details.

Rebasing your changes. Others may be making changes to KStars at the same time you are working on your feature. Rebasing is updating your version of KStars and your particular changes to make it as if you changed the latest KStars version, e.g. reflect changes to the codebase made after you cloned or updated your own KStars copy. This is a significant topic you can Google, but the following instructions work most of the time.

cd ~/Projects/kstars
git checkout master
git pull upstream master  # Get the master from the main KStars repo onto your local clone
git push origin master    # Then push your updated local clone into your forked repo
git checkout YOUR_BRANCH_NAME
git rebase master
git push origin YOUR_BRANCH_NAME -f

If there are complications with the rebase, git will make suggestions on how to correct the issues.

Your next change. Once your Merge Request is complete (and possibly integrated into KStars), you may wish to move on and develop again. The next change will use another (new) feature branch, and the first feature branch could be deleted. You may want to run the following regularly to keep your master branch up-to-date with KStars.

cd ~/Projects/kstars
git checkout master
git pull upstream master  # Get the master from the main KStars repo onto your local clone
git push origin master    # Then push your updated local clone into your forked repo

Writing Tests

Tests are stored in the

folder and use QTest as support framework: * Unitary tests can be found in
, etc. They try to verify the behavior of a minimal set of classes, and are support for feature development. * UI tests can be found in
. They execute use cases as the end-user would do from the user interface, and focus on availability of visual feedback and stability of procedures.

Writing Unitary Tests

  1. Decide where your new unitary test will reside in

    . KStars classes should live in a folder matching their origin: for instance, auxiliary class tests live in
    . Find a suitable place for your test, based on the part of the system that is being tested. As an example, a folder named
  2. Create a new unitary test class, or copy-paste an existing unitary test to a new one. Check

    as an example. Name the
    files as "test[lowercase kstars class]" (for instance "testthatkstarsclass"), and update them to match the following: ``` /* [Author+Licence header] */





class TestThatKStarsClass: public QObject { Q_OBJECT public: explicit TestThatKStarsClass(QObject *parent = null);

private slots: void initTestCase(); // Will trigger once at beginning void cleanupTestCase(); // Will trigger once at end

void init();                            // Will trigger before each test
void cleanup();                         // Will trigger after each test

void testThisParticularFunction_data(); // Data fixtures for the test function (Qt 5.9+) void testThisParticularFunction(); // Test function



/* [Author+Licence header] */

include "testthatkstarsclass.h"

TestThatKStarsClass::TestThatKStarsClass(QObject* parent): QObject(parent) {} TestThatKStarsClass::initTestCase() {} TestThatKStarsClass::cleanupTestCase() {} TestThatKStarsClass::init() {} TestThatKStarsClass::cleanup() {}

TestThatKStarsClass::testThisParticularFunction_data() { // If needed, add data fixtures with QTest::AddColumn/QTest::AddRow, each will trigger testThisParticularFunction }

TestThatKStarsClass::testThisParticularFunction() { // Write your tests here, eventually using QFETCH to retrieve the current data fixture }


You can use a single file to hold both declaration and definition, but you will need to
#include "testthatkstarsclass.moc"` between the declaration and the definition.
  1. Update the CMake configuration to add your test. If you created a new folder, create a new

    to add your test:
    ADD_EXECUTABLE( testthatkstarsclass testthatkstarsclass.cpp )
    TARGET_LINK_LIBRARIES( testthatkstarsclass ${TEST_LIBRARIES})
    ADD_TEST( NAME ThatKStarsClassTest COMMAND testthatkstarsclass )
    Have the
    residing one folder higher in the filesystem include that
    by adding:
    Make sure you add your
    in the right dependency group. Ekos tests require
    for instance.
  2. Write your tests Make sure you document behavior with your tests. If you happen to find a bug, don't fix it, mark it with an

    macro. The test will document the incorrect behavior while the bug is alive, and will fail when the bug is fixed. Then only after that the test may be updated. Also pay attention to Qt library version support. For instance, data fixtures require Qt 5.9+.

Writing User Interface Tests

Follow the same steps as for unitary tests, but locate your test classes in


One important thing about UI tests is that they must all use

, so that they execute with a separate user configuration that is initially blank. User interface tests thus require a preliminary setup to function properly, such as using the new configuration wizard or setting the geographical location up. For this reason, you need to add the execution of your test in
, in
, after the execution of

A second important thing about QTest generally is that test functions have no return code. One therefore needs to write macros to factor duplicated code. You will find many existing macros in the header files of

test classes, to retrieve gadgets, to click buttons or to fill

A third important thing about the KStars interface is that it mixes KDE and Qt UI elements. Thus, sometimes tests require verification code to be moved to a

call, and sometimes even clicking on a button has to be made asynchronous for the test to remain in control (modal dialogs). Fortunately, these hacks do not alter the execution of the tested code.

When testing, you need to make sure you always use elements that the end-user is able to use. Of course, if a test requires a setup that is not actually part of the interesting calls, you may hack a direct call. For instance, some Ekos tests requiring the Telescope Simulator to be pointing at a specific location use

. Remember that sometimes you need to leave time for asynchronous signals to be emitted and caught.


The KStars Team

Original Author

Jason Harris [email protected]

Current Maintainer

Jasem Mutlaq [email protected]

Contributors (Alphabetical)

Data Sources:

Most of the catalog data came from the Astronomical Data Center, run by NASA. The website is:

NGC/IC data is compiled by Christian Dersch from OpenNGC database. Check LICENSE_OpenNGC for license details (CC-BY-SA-4.0)

Supernovae data is from the Open Supernova Catalog project at Please refer to the published paper here:

KStars links to the excellent image collections and HTML pages put together by the Students for the Exploration and Development of Space, at:

KStars links to the online Digitized Sky Survey images, which you can query at:

KStars links to images from the HST Heritage project, and from HST press releases:

KStars links to images from the Advanced Observer Program at Kitt Peak National Observatory. If you are interested in astrophotography, you might consider checking out their program:

Credits for each image used in the program are listed in README.images

Original Acknowledgement from the Project Founder

KStars is a labor of love. It started as a personal hobby of mine, but very soon after I first posted the code on Sourceforge, it started to attract other developers. I am just completely impressed and gratified by my co-developers. I couldn't ask for a more talented, friendly crew. It goes without saying that KStars would be nowhere near what it is today without their efforts. Together, we've made something we can all be proud of.

We used (primarily) two books as a guide in writing the algorithms used in KStars: + "Practical Astronomy With Your Calculator" by Peter Duffett-Smith + "Astronomical Algorithms" by Jean Meeus

Thanks to the developers of Qt and KDE whose peerless API made KStars possible. Thanks also to the tireless efforts of the KDE translation teams, who bring KStars to a global audience.

Thanks to everyone at the KDevelop message boards and on, for answering my frequent questions.

Thanks also to the many users who have submitted bug reports or other feedback.

You're still reading this? :) Well, that's about it. I hope you enjoy KStars!

Jason Harris [email protected]

KStars Development Mailing list [email protected]

Send us ideas and feedback!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.